You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrated issue, originally created by Cody Taylor (@CodeMan99)
The documentation for Returning early from a template should suggest return an empty string. Otherwise python returns None and that may appear in your rendered template.
We should also consider adding a constant to represent exiting a template for two reasons.
Seeing return in the middle of a block of text can be very confusing since its normal syntax only holds meaning within a function or method.
Would ensure that the suggestion of returning an empty string allows holds true. The first time I saw None in my rendered template I was really confused.
I would be more than willing to implement this change, but I would not know where to add the suggested constant.
The text was updated successfully, but these errors were encountered:
add the constant to mako/runtime.py, have it be available in templates which means its part of codegen.py in the symbols at the top (e.g. like UNDEFINED), then make the appropriate changes in the doc rst's. the docs have to include a ".. versionadded:: " directive to show that this constant isn't available in older versions of Mako also ( I can help format those).
Migrated issue, originally created by Cody Taylor (@CodeMan99)
The documentation for Returning early from a template should suggest return an empty string. Otherwise python returns
None
and that may appear in your rendered template.We should also consider adding a constant to represent exiting a template for two reasons.
None
in my rendered template I was really confused.I would be more than willing to implement this change, but I would not know where to add the suggested constant.
The text was updated successfully, but these errors were encountered: