You can use type hinting with stub files in Python 2.7 per https://www.python.org/dev/peps/pep-0484/#stub-files
However I cannot make it work for method signatures in subclasses.
In stub file a.pyi:
class A(object):
def foo(self, timestamp: float): ...
In Python 2.7 file b.py
class B(A):
def foo(self, timestamp):
print(timestamp) # Inferred type of timestamp is not float!
PyCharm 2017.3.3 does not infer timestamp as float. I did not check the behavior of mypy.
There are two workarounds which bring code redundancies (not preferred)
Workaround 1
In stub file b.pyi
class B(A):
def foo(self, timestamp: float): ...
Workaround 2
In Python 2.7 file b.py
class B(A):
def foo(self, timestamp): # type: (float) -> None
print(timestamp)