I have python def definition which seems working for python3:
def get_default_device(use_gpu: bool = True) -> cl.Device:
Under python2 I get the following syntax error:
root:~/pyopencla/ch3# python map_copy.py
Traceback (most recent call last):
File "map_copy.py", line 9, in <module>
import utility
File "/home/root/pyopencla/ch3/utility.py", line 6
def get_default_device(use_gpu: bool = True) -> cl.Device:
^
SyntaxError: invalid syntax
How to make type hints compatible with python2?