Skip to content

Do not ignore _globalns that is set via inject()#60

Merged
RobertoPrevato merged 2 commits intoNeoteroi:mainfrom
sobolevn:patch-5
Mar 8, 2026
Merged

Do not ignore _globalns that is set via inject()#60
RobertoPrevato merged 2 commits intoNeoteroi:mainfrom
sobolevn:patch-5

Conversation

@sobolevn
Copy link
Contributor

@sobolevn sobolevn commented Jul 7, 2024

This way you can actually override some things from module's namespace with inject() function. It is very useful for tests.

@RobertoPrevato RobertoPrevato merged commit 7382dd7 into Neoteroi:main Mar 8, 2026
6 checks passed
@RobertoPrevato
Copy link
Member

Thanks @sobolevn, and sorry for not merging your PRs earlier. Thanks to the productivity boost of GH Copilot, I am now able to follow-up on all pending issues and PRs from the past while still focusing on blacksheep. In this case, Copilot detected two bugs in your original PR and fixed them.

Just for future record (Claude Sonnet 4.6):

  • Both bugs fixed: dict(vars(...)) copy to avoid mutating the live module namespace, and _get_obj_globals (not _get_obj_locals) in __call__.
  • New-style dict[str, Any] annotation on _get_obj_globals.
  • Two new tests covering both the annotation-based and init-based resolution paths.
  • 179 tests passing.

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.

2 participants