2

Is there any way to make python 3 code containing type hinting annotations to work with python 2 also?

def get(axyz: list, window_size: int=WINDOW_SIZE) -> numpy.array:
    return numpy.array(axyz)

More importantly is that even possible?

Shubham Chaudhary
  • 47,722
  • 9
  • 78
  • 80

1 Answers1

0

The type annotating syntax is not valid in python2. pep484 mentions stub files for compatibility with python2.

syntonym
  • 7,134
  • 2
  • 32
  • 45