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

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

Closed
sqlalchemy-bot opened this issue Nov 17, 2008 · 2 comments

Comments

@sqlalchemy-bot
Copy link

@sqlalchemy-bot sqlalchemy-bot commented Nov 17, 2008

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")

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Nov 17, 2008

Michael Bayer (@zzzeek) wrote:

f19509f

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Nov 17, 2008

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.