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

Deprecate merged extensions #1203

Closed
davidism opened this issue May 9, 2020 · 7 comments · Fixed by #1243
Closed

Deprecate merged extensions #1203

davidism opened this issue May 9, 2020 · 7 comments · Fixed by #1243
Milestone

Comments

@davidism
Copy link
Member

davidism commented May 9, 2020

autoescape and with have been in the standard compiler for years now. The extensions do nothing. Make them issue a deprecation warning, for removal in 3.1.

@davidism davidism added this to the 3.0.0 milestone May 9, 2020
@septatrix
Copy link
Contributor

I think it may be better to add the deprecation warning in a new minor 2.x release and remove them in 3.0

@FawziyahAlebiosu
Copy link
Contributor

@davidism for clarification, would this warning be printed when this (

def autoescape(template_name):
) is called?

@davidism
Copy link
Member Author

This warning would be for the extensions, that function is part of the built-in support that superseded the extensions.

The extensions are in ext.py, you'd want to override the __init__ method for WithExtension, and AutoEscapeExtension to show a deprecation warning.

@FawziyahAlebiosu
Copy link
Contributor

@davidism Because those two classes take in this init method here:

def __init__(self, environment):

would it be more efficient to add the warning to THAT method, or should I create an init method for those two classes, and use THAT to override and show the warning?

@davidism
Copy link
Member Author

Only those two extensions are deprecated, not all extensions, so you shouldn't add the deprecation to the base class.

@FawziyahAlebiosu
Copy link
Contributor

that makes sense to me. Is it okay to begin working on this?

@davidism
Copy link
Member Author

Sure!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants