[issue6148] Help well execute code it is called on

Ezio Melotti report at bugs.python.org
Sat May 30 08:55:23 CEST 2009


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

Default args are evaluated when the module is imported, if the arg is a
function call, the function is called.
You can see how the file is created just after the import, you don't
even need to call help().

This behavior is documented here:
http://docs.python.org/tutorial/controlflow.html#default-argument-values

The doc doesn't mention explicitly function calls, that could be added.

----------
components:  -Interpreter Core
nosy: +ezio.melotti
versions:  -Python 2.5, Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6148>
_______________________________________


More information about the Python-bugs-list mailing list