Consider making starlette.templating.Jinja2Templates.get_env
"protected"
#1194
Labels
clean up
Refinement to existing functionality
Hi,
Thank you very much for your project! We are using it intensively through FastAPI.
While I was exploring the code base and looking how to use
Jinja2Templates
, I noticed the methodget_env
. At first I thought it was a getter for the environment, but eventually realized it is only called in the constructor of the class.It would make much more sense to me if the method was called
_get_env
. This would signal that it should not be used outside of the class (or at least that the caller needs to know what she is doing).For example, if I want to add filters or globals to the environment, I should write:
instead of:
As of current implementation, the second snippet has no effect.
Thank you very much for considering this request!
The text was updated successfully, but these errors were encountered: