Peculiarity (bug?) with default parameters to external methods
Hi all I'm seeing funny behaviour when using external methods with default parameters. Martijn Faassen says it best in a posting from three years ago: From my (limited) perspective it still looks as if all works just as expected (in the Python sense), *except* when I use default parameters in the external methods, and only then when I don't use the explicit "foo='bar'" method of parameter passing. http://lists.zope.org/pipermail/zope/1999-February/086018.html I won't bore you with a description of what exactly goes wrong. In short, when I have:: def makeTSV(self, rows, field_names = None): then 'rows' gets a completely spurious value. When I have:: def makeTSV(self, rows, field_names): 'rows' works as expected. I didn't find any more enlightening docs or posts. Does this sound familiar to anyone? Regards, Jean Jordaan
Jean Jordaan writes:
I'm seeing funny behaviour when using external methods with default parameters. Martijn Faassen says it best in a posting from three years ago: Your archive search could have been more thorrough. You could have found a post from me (and earlier from someone from DC) explaining the problems with default parameters.
You either search again or read the "External Method" section in <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
participants (2)
-
Dieter Maurer -
Jean Jordaan