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

Expose default namespace object. #24

Closed
wants to merge 1 commit into from

Conversation

rwe
Copy link

@rwe rwe commented Dec 10, 2015

This also supports diagnostic utilities that inspect the global namespace. This also makes it convenient to write consistent code that is parameterized on a namespace, but that still functions with the global namespace. Additionally, not exposing the global namespace encourages writing codes that refers to it only implicitly, which is more painful to refactor later.

In those use cases, the alternative to library users is something brittle like:

from blinker import signal

namespace = signal.im_self

For additional discussion, see the original PR #23

This is useful for when you still only have a single global namespace
and want to use the global `signal` helper function, but want to be able
to modify or inspect that namespace. This also makes it possible to
write consistent code that is parameterized on a namespace, but can
still function with the global namespace. This also enables support for
diagnostic tools that inspect the global namespace.
@davidism
Copy link
Member

This is too old to merge cleanly, but the idea makes sense, so I've done it in the current code in #145.

@davidism davidism closed this Apr 27, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants