Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from __future__ import annotations not respected #36

Closed
sweettuse opened this issue Mar 29, 2024 · 3 comments
Closed

from __future__ import annotations not respected #36

sweettuse opened this issue Mar 29, 2024 · 3 comments

Comments

@sweettuse
Copy link
Contributor

sweettuse commented Mar 29, 2024

on recompile of a function definition change, jurigged does not respect from __future__ import annotations

say you have a module like this:

from __future__ import annotations

def f(a: tuse) -> int:
    ...

and say you run jurigged my_module.py
and say you additionally change:

def f(a: tuse) -> int:
# to
def f(a: tuse) -> str:

jurigged raises an error in reevaluation (NameError: tuse is not defined or something like that).

the reason is that the appropriate future flags aren't passed into the compile function.

i'll push a fix for this shortly, just wanted to create an issue first.

@sweettuse
Copy link
Contributor Author

created PR #37 for this issue a few days ago. @breuleux if you can take a look when you have a chance.

@benbuckman
Copy link

👋 Thanks for the fix here. Since the PR was merged, can this issue be closed? Thanks!

@breuleux
Copy link
Owner

Yeah, I had to publish a new version on PyPI first, so that's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants