[Zope] External method default arg weirdness

Dieter Maurer dieter@handshake.de
Fri, 11 May 2001 21:42:38 +0200 (CEST)


Nils Kassube writes:
 > * Dieter Maurer <dieter@handshake.de> [2001-05-09 22:02]:
 >  
 > >   This magic works only, if the method is called with
 > >   precisely one parameter less then the required
 > >   arguments. It breaks very likely, when there are
 > >   default parameters. In this case, you need to pass
 > >   the "self" parameter explicitly and can not count on
 > >   the magic.
 > 
 > Nice. So http://www.zope.org/Documentation/How-To/ExternalMethods
 > is wrong in claiming that
 > 
 > --cut--
 > Argument semantics for External Methods are identical to those for
 > normal Python methods. You can define External Methods with default or
 > keyword arguments just as you can in Python.
 > --cut--
It depends, how you read it:

  Of course, you can define External Methods with default
  and keyword arguments.

  It will work fine, when you pass the object argument explicitly.
  It will also work fine, if called through the Web
  (as ZPublisher uses different magic).
  Only the automatic passing of the object argument when
  called from DTML will not work.


Dieter