Skip to content

including file w/o overriding a __builtin__ var name default arg fails in 0.2.2 (worked in 0.1.8) #93

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Anonymous

If the included file specifies default page args that are the same name as a builtin then it is rendered as "builtin function" rather than the default value:

include me: test1.mako

<% page args="id='foo'/>

call the included file w/o passing in "id":

<% include file="test1.mako" />

The use case is thus: the included file might be rendered once per page (in which the default "id" is fine) or multiple times (in which case each "id" must be unique so in these cases a unique id is passed). This seems pythonic since, if you specify a default keyword arg, then it is the default:

def pyiscool(varname="id"):
print varname

So I might invoke it as pyiscool() or pyiscool("another_id")

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