[Zope] External method default arg weirdness
Dieter Maurer
dieter@handshake.de
Tue, 8 May 2001 20:48:42 +0200 (CEST)
Paul Winkler writes:
> This is with Zope 2.2.2.
> If I give a default argument to the external method, and call it
> from a dtml method, the default gets used even if I pass the
> argument.
>
> Example: Try creating two external methods and calling them like
> this from standard_html_footer.
>
> <dtml-var "my_ext_method1(_['id'])">
> <dtml-var "my_ext_method2(_['id'])">
>
>
> Here are the two external method definitions:
>
> def my_ext_method1(id):
> return "<br>%s" % id
>
> def my_ext_method2(id="oops"):
> return "<br>%s" % id
>
>
>
> Anybody else get this? Why does it do that?
I know this only, if the first parameter is called "self".
We use default parameters regularly (in Zope 2.1.6) and
they work as expected.
Dieter