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

The out of scope variable: mention nonlocal #193

Closed
actionless opened this issue Apr 6, 2020 · 4 comments
Closed

The out of scope variable: mention nonlocal #193

actionless opened this issue Apr 6, 2020 · 4 comments

Comments

@actionless
Copy link

https://github.com/satwikkansal/wtfpython#-the-out-of-scope-variable

To modify the outer scope variable a in another_func, use global keyword.

https://docs.python.org/3/reference/simple_stmts.html#grammar-token-nonlocal-stmt

@diptangsu
Copy link
Contributor

I would love to add this to this repo!

@satwikkansal
Copy link
Owner

Sure @diptangsu, Feel free to submit a PR for this.

diptangsu added a commit to diptangsu/wtfpython that referenced this issue Oct 2, 2020
@diptangsu
Copy link
Contributor

I have submitted a PR. I also made some extra changes. Let me know if I need to change something, I'll add the required changes and add another commit!

satwikkansal pushed a commit that referenced this issue Oct 5, 2020
* fixed link to CONTRIBUTORS.md

* The out of scope variable, nonlocal, #193

* added myself to CONTRIBUTORS.md :D

* Update CONTRIBUTORS.md

* added entry in index

* merged nonlocal to `the out of scope variable` example

Also removed the extra entry from the main index.
@satwikkansal
Copy link
Owner

Thank you @diptangsu for going beyond just mentioning nonlocal and adding a nice example for it. Really appreciate it :)

muscliary pushed a commit to muscliary/wtfpython that referenced this issue Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants