Skip to content

Deprecate pyramid.util.DottedNameResolver. - #3837

Open
luhn wants to merge 3 commits into
Pylons:mainfrom
luhn:deprecate-util-resolver
Open

luhn wants to merge 3 commits into
Pylons:mainfrom
luhn:deprecate-util-resolver

Conversation

@luhn

@luhn luhn commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

pyramid.util.DottedNameResolver has long been an alias for pyramid.path.DottedNameResolver. With the addition of resource utils in #3835, pyramid.path will import pyramid.util in the future, causing a circular dependency.

This PR official deprecates pyramid.util.DottedNameResolver and replaces it with a lazy-load shim to avoid the circular dependency. It's not a perfect replacement but is pretty close.

Remove top-level `pyramid.resolver` import to prevent future circular
dependencies.
@luhn

luhn commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Some alternatives:

  • Move pyramid.util.resource_filename somewhere else (maybe into path?)
  • Move pyramid.path import to the bottom (also requires pyramid.util import in pyramid.path to be at the bottom, so it's kinda messy.)
  • Voodoo magic __getattr__ load DottedNameResolver on demand.

Comment thread src/pyramid/util.py Resolved
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