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

Add context manager for allowing unresolved templates and make the state members private #4735

Open
wants to merge 7 commits into
base: 5.0.x
Choose a base branch
from

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jan 3, 2025

Both (templating and disabling the enforcing) should only be disabled temporarily so make the state private and expose only the context manager and a property.

2 small fixes in adjacent code:

  • Use a try-except instead of an if-else (avoids an extra lookup)
  • Use the resolve_template member instead of the free function to remove some C&P code

I also intended to make asdict trivial (see 2a63863) but as __getitem__ checks for deprecated parameters on each access it might impact performance too much.

Improvement after #4726

@Flamefire Flamefire force-pushed the resolve-context-manager branch from 1c7bdec to 45196fb Compare January 3, 2025 14:48
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.

1 participant