alex23 [EMAIL PROTECTED] writes:
On Nov 21, 9:40 am, J Kenneth King [EMAIL PROTECTED] wrote:
Of course, providing a shallow (or deep as necessary) copy makes it
work, I'm curious as to why the value passed as a parameter to a
function outside the class is passed a reference rather than a
Steven D'Aprano [EMAIL PROTECTED] writes:
On Thu, 20 Nov 2008 18:31:12 -0500, J Kenneth King wrote:
Of course I expected that recursive_func() would receive a copy of
weird_obj.words but it appears to happily modify the object.
I am curious why you thought that. What made you think Python
On Fri, 21 Nov 2008 10:12:08 -0500, J Kenneth King wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
I am curious why you thought that. What made you think Python should/did
make a copy of weird_obj.words when you pass it to a function?
[snip]
Of course if there is any further reading on the
Peter Pearson [EMAIL PROTECTED] writes:
On Fri, 21 Nov 2008 10:12:08 -0500, J Kenneth King wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
I am curious why you thought that. What made you think Python should/did
make a copy of weird_obj.words when you pass it to a function?
[snip]
Of
J Kenneth King wrote:
I was working on a program of some complexity recently and quickly
caught the issue in my tests. I knew what was going on and fixed it
expediently, but the behaviour confused me and I couldn't find any
technical documentation on it so I figured I just didn't know what it
I recently encountered some interesting behaviour that looks like a bug
to me, but I can't find the appropriate reference to any specifications
to clarify whether it is a bug.
Here's the example code to demonstrate the issue:
class SomeObject(object):
def __init__(self):
self.words
J Kenneth King [EMAIL PROTECTED] writes:
I recently encountered some interesting behaviour that looks like a bug
to me, but I can't find the appropriate reference to any specifications
to clarify whether it is a bug.
Here's the example code to demonstrate the issue:
class
On Nov 21, 9:40 am, J Kenneth King [EMAIL PROTECTED] wrote:
Of course, providing a shallow (or deep as necessary) copy makes it
work, I'm curious as to why the value passed as a parameter to a
function outside the class is passed a reference rather than a copy.
You're passing neither a
On Nov 20, 6:40 pm, J Kenneth King [EMAIL PROTECTED] wrote:
J Kenneth King [EMAIL PROTECTED] writes:
I recently encountered some interesting behaviour that looks like a bug
to me, but I can't find the appropriate reference to any specifications
to clarify whether it is a bug.
Here's
On Nov 21, 6:31 am, J Kenneth King [EMAIL PROTECTED] wrote:
I recently encountered some interesting behaviour that looks like a bug
to me, but I can't find the appropriate reference to any specifications
to clarify whether it is a bug.
Here's the example code to demonstrate the issue:
class
On Thu, 20 Nov 2008 18:31:12 -0500, J Kenneth King wrote:
Of course I expected that recursive_func() would receive a copy of
weird_obj.words but it appears to happily modify the object.
I am curious why you thought that. What made you think Python should/did
make a copy of weird_obj.words
J Kenneth King [EMAIL PROTECTED] writes:
I recently encountered some interesting behaviour that looks like a bug
to me, but I can't find the appropriate reference to any specifications
to clarify whether it is a bug.
Here's the example code to demonstrate the issue:
class
12 matches
Mail list logo