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
wa
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?
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 readin
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
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 t
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 SomeObjec
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 wh
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:
>
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
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 ref
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 SomeObjec
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
12 matches
Mail list logo