Thanks. Not sure if it is useful for me as I still have to use python 2.7
UPDATE: I didn't see the python stubs, that made my day! lot of thanks for it!
UPDATE: I didn't see the python stubs, that made my day! lot of thanks for it!
self.ivar = 1 # type: int
self.ivar = [1]
""" :type: list[int] """
def fun(arg1, arg2): # type: (int, str) -> str
def fun(arg):
"""
:param int or str arg:
:rtype: str or None
"""
I like the comment version (e.g. `# type: int`) better (plus its officially defined in PEP 484), but sadly they tend not to work as well, sometimes due to not being able to `import typing`, and sometimes for other less clear reasons.