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

Sample code for the article on namespace #659

Merged
merged 9 commits into from
Apr 7, 2025
Merged

Conversation

lpozo
Copy link
Contributor

@lpozo lpozo commented Mar 26, 2025

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

Comment on lines 3 to 5
# print(message)
# globals()["message"] = "Hello, World!"
# print(message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpozo I assume you commented these out to satisfy the linter checks? In the future, you can use the special # noqa comment to suppress the linter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently this doesn't work:

image

Copy link
Contributor

@bzaczynski bzaczynski left a 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 😉



def outer():
# x = "enclosing"
Copy link
Contributor

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?

Comment on lines 12 to 17
# print(loc)
# number = 42
# print(f"{loc=}")
# loc["message"] = "Welcome!"
# print(f"{loc=}")
# print(locals())
Copy link
Contributor

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.



# f()
# fruits
Copy link
Contributor

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().

@brendaweles brendaweles merged commit 13dd736 into master Apr 7, 2025
1 check passed
@brendaweles brendaweles deleted the python-namespace branch April 7, 2025 21:59
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

Successfully merging this pull request may close these issues.

3 participants