sqlalchemy / mako

Mako Templates for Python
https://www.makotemplates.org
MIT License
353 stars 60 forks source link

Keyword only arguments after bare `*` are not enforced because of rewrite. #405

Open ianjosephwilson opened 2 months ago

ianjosephwilson commented 2 months ago

I guess technically this is a bug but seems pretty insignificant especially since it has been 10 years since the last seemingly related commit.

This should produce a TypeError but seems to not to by accident because the bare * is rewritten out:

<%def name="kwonly(a, *, b=15)">
a=${a} b=${b}
</%def>

${kwonly(1, 2)}