Skip to content

using caller inside of <%call> can be polluted #170

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Michael Bayer (@zzzeek)

moving the call to <%self:A> below the caller changes to an endless loop, removing the <%self:A> call altogether removes the issue. So <%self:A> is affecting the identity of caller and it appears to be a codegen issue.

from mako.template import Template

x = """
<%def name="A()">
A
${caller.body()}
</%def>

<%def name="B()">
B
${caller.body()}
</%def>

<%def name="C()">
 C
 <%self:B>
   <%self:A>
      A body
   </%self:A>
    B body
   ${caller.body()}
 </%self:B>
</%def>

<%self:C>
C body
</%self:C>
"""
t = Template(x)
print t.code
print t.render()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions