python-anydi
anydi
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
feat(scopes): add isolated scope re-entry via replace flag Add a `replace` flag to scoped_context / ascoped_context: by default, re-entering an active scope reuses its context (unchanged), and with replace=True a fresh, isolated context is opened that shadows the active one and is restored on exit. Also add get_scoped_context / try_get_scoped_context to read the active context for a scope without entering a new one, reset the scope token in a finally block to avoid a context-var leak when the body raises, and make the override resolver getter re-resolve wrapped dependencies against the context the instance was created in so nested resolution reads from the correct scope. The default (replace=False) is backwards compatible.
attilavetesi-epam:feat/replaceable-scopes
16 days ago
feat(scopes): add replaceable scopes and reentry control Add a 'replaceable' flag to register_scope so a scope can be re-entered as a fresh, isolated context, and two orthogonal per-call arguments on scoped_context / ascoped_context: - reentry: forbid | require | allow (default) -- an assertion about whether this entry may or must be a re-entry of an already-active same-scope context. 'forbid' = must be the root entry, 'require' = must be nested in an active one, 'allow' = either. - on_reentry: reuse (default) | replace -- what to do when a re-entry actually happens. 'reuse' yields the active context; 'replace' opens a fresh, isolated context (requires replaceable=True) that shadows the active one and restores it on exit. Ignored on a first entry. Add get_scoped_context / try_get_scoped_context to read the active context for a scope without entering a new one. The override resolver getter now resolves wrapped dependencies against the context the instance was created in, so re-resolution during replacement reads from the correct scope. Defaults (reentry='allow', on_reentry='reuse') are backwards compatible.
attilavetesi-epam:feat/replaceable-scopes
18 days ago
Release 0.75.0
main
25 days ago
Merge pull request #301 from python-anydi/latest-fastapi-support Add latest FastAPI version support
main
25 days ago
Add latest FastAPI version support
latest-fastapi-support
25 days ago
Merge pull request #300 from python-anydi/ty-migrate Migrate to ty
main
25 days ago
Migrate to ty
ty-migrate
25 days ago
Merge pull request #299 from python-anydi/fix/child-scope-from-context-resolution Fix child scope providers unable to access parent scope from_context …
main
5 months ago
Latest Branches
CodSpeed Performance Gauge
0%
feat(scopes): add isolated scope re-entry via replace flag
#302
1 month ago
18ab3c8
attilavetesi-epam:feat/replaceable-scopes
CodSpeed Performance Gauge
0%
Add latest FastAPI version support
#301
25 days ago
d322617
latest-fastapi-support
CodSpeed Performance Gauge
-2%
Migrate to ty
#300
25 days ago
7fe3be7
ty-migrate
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs