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

About TODO_ENCLOSING #54

Open
aroberge opened this issue Nov 2, 2020 · 1 comment
Open

About TODO_ENCLOSING #54

aroberge opened this issue Nov 2, 2020 · 1 comment

Comments

@aroberge
Copy link

aroberge commented Nov 2, 2020

Hi,

I'm slowly implementing some of your ideas for my own project (friendly-traceback). I noticed that you had a comment about labelled TODO_ENCLOSING which I understood to mean nonlocal scopes.

I have implemented something that does that in my own project:
get_variables_in_frame_by_scope in info_variables.py currently found at https://github.com/aroberge/friendly-traceback/blob/master/friendly_traceback/info_variables.py#L16

Perhaps this could be of some use to you in relation to that comment.

I do recognize that my code is not as tight/efficient as yours, as I am trying to graft something like DidYouMean-Python into a project that was not designed for it initially.

@SylvainDe
Copy link
Owner

Hello,
Thanks for your suggestion! It does seem like the kind of things I should have implemented! It would definitely help me implement that missing feature.

SylvainDe added a commit that referenced this issue Nov 2, 2020
André Roberge mentionned that he had implemented logic
to retrieve non-locals variables in his own project as
per:
    https://github.com/aroberge/friendly-traceback/blob/master/friendly_traceback/info_variables.py#L16

A few things can be improved in a second time:
 - write tests using the "nonlocal" keyword
 - add suggestions for re.NO_BINDING_NONLOCAL_RE
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

2 participants