One of the most talked about features in Python 3.5 is type hints.
An example of type hints is mentioned in this article and this o
Type-hints are for maintainability and don't get interpreted by Python. In the code below, the line def add(self, ic:int) doesn't result in an error until the next return... line:
class C1:
def __init__(self):
self.idn = 1
def add(self, ic: int):
return self.idn + ic
c1 = C1()
c1.add(2)
c1.add(c1)
Traceback (most recent call last):
File "", line 1, in
File "", line 5, in add
TypeError: unsupported operand type(s) for +: 'int' and 'C1'