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
Description:
Trying to stickytape a file containing a future statement results in an error:
SyntaxError: from __future__ imports must occur at the beginning of the file
Steps to reproduce:
Write file a.py
from __future__ import annotations
def f(x: str | int) -> str | int:
return 2 * x
Run stickytape a.py > b.py
Run python b.py
Expected result:
Nothing
Actual result:
File "b.py", line 37
from __future__ import annotations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: from __future__ imports must occur at the beginning of the file
Possible fix:
Detect such statements, for instance with a regex pattern, and move them at the beginning of the file.
re.match('from __future__ import (.*)$', line)
The text was updated successfully, but these errors were encountered:
Description:
Trying to stickytape a file containing a future statement results in an error:
Steps to reproduce:
a.py
stickytape a.py > b.py
python b.py
Expected result:
Nothing
Actual result:
Possible fix:
Detect such statements, for instance with a regex pattern, and move them at the beginning of the file.
The text was updated successfully, but these errors were encountered: