FYI, I have opened a bug on the official tracker:
http://bugs.python.org/issue3403.
--
http://mail.python.org/mailman/listinfo/python-list
On 18 Lug, 13:23, Sebastian \lunar\ Wiesner
[EMAIL PROTECTED] wrote:
It _is_ the correct thing. Evaluation of default parameters at declaration
time and not at invocation is truely a language feature, not a bug.
You'll find your bug report being closed quickly.
It has ;). I had totally
New submission from SukkoPera [EMAIL PROTECTED]:
I have just encountered a Python behaviour I wouldn't expect. Take
the following code:
class Parent:
a = 1
def m (self, param = a):
print
On 14 Lug, 10:34, Peter Otten [EMAIL PROTECTED] wrote:
John Mechaniks wrote:
from subprocess import call
call(['ls', '-l'])
How do I get the result (not the exit status of the command) of ls -
l into a variable?
output = subprocess.Popen([ls, -l], stdout=subprocess.PIPE).stdout.read()
Hi, I have just encountered a Python behaviour I wouldn't expect. Take
the following code:
class Parent:
a = 1
def m (self, param = a):
print param = %d % param
class Child (Parent):
On 13 Lug, 19:42, [EMAIL PROTECTED] wrote:
I expect it's because default values for parameters are evaluated and
bound at definition time. So once def m (self, param = a): line
executes, the default value for parameter is forever bound to be 1.
What you can do is for example:
Yes, that's what