-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Sample code for the article on namespace #659
base: master
Are you sure you want to change the base?
Conversation
python-namespace/globals_func.py
Outdated
# print(message) | ||
# globals()["message"] = "Hello, World!" | ||
# print(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpozo Approved with some comments 😉
python-namespace/legb_3.py
Outdated
|
||
|
||
def outer(): | ||
# x = "enclosing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpozo Same reason for the comment as before?
python-namespace/locals_func.py
Outdated
# print(loc) | ||
# number = 42 | ||
# print(f"{loc=}") | ||
# loc["message"] = "Welcome!" | ||
# print(f"{loc=}") | ||
# print(locals()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpozo These print calls could also use f-strings to keep them consistent with the updated tutorial.
python-namespace/mutability.py
Outdated
|
||
|
||
# f() | ||
# fruits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpozo This should probably be wrapped in a call to print()
.
Where to put new files:
my-awesome-article
How to merge your changes: