You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
future doesn't support python3 functions annotations #2
Thanks for reporting this. Yes, this is a known limitation. Any Python 3-only syntax will fail to run on Python 2; importing future cannot help with this because Python won't even attempt to run code that generates a SyntaxError.
The futurize script could potentially convert function annotations into the following syntax, which is compatible with both Py2 and Py3 (using your example)::
Activity
edschofield commentedon Oct 21, 2013
Hi @matclab,
Thanks for reporting this. Yes, this is a known limitation. Any Python 3-only syntax will fail to run on Python 2; importing
futurecannot help with this because Python won't even attempt to run code that generates a SyntaxError.The
futurizescript could potentially convert function annotations into the following syntax, which is compatible with both Py2 and Py3 (using your example)::Would this meet your use-case? I have filed this as a feature request in issue #3.
matclab commentedon Nov 2, 2013
I may give a try, but I can not see why it won't work for my use case…
Thanks for having considered it.