> They are. You've stiumbled on one of those Python peculiarities of
> implementation that can be useful and annoying in equal measure.
>
>> class Test(object):
>> def __init__(self, name, paths=[]):
>> self.name = name
>> self.paths = paths
>
> When you give a function/method a default value
On 25/05/16 17:05, Alex Hall wrote:
> Python for a while so eventually unsubscribed.
Welcome back Alex :-)
> Now I'm using Python for work, and have run into a problem that has me
> baffled. It's as though a bunch of class instances in a list are sharing a
> single property.
They are. You've s
Alex Hall wrote:
> class Test(object):
> def __init__(self, name, paths=[]):
https://docs.python.org/2/faq/programming.html#why-are-default-values-shared-between-objects
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription o
Hello all,
I've used Python off and on for years, and consider myself pretty good with
it. I was on this list quite a while ago and learned a lot, but hadn't used
Python for a while so eventually unsubscribed.
Now I'm using Python for work, and have run into a problem that has me
baffled. It's as