Right, thanks everyone, that's a useful lesson learned. As I suspected I
was being tripped over by some feature of Python I was unaware of. I had
been looking up lists in the documentation, not functions, and could find
no explanation.
Prbolem solved!
--
--
http://mail.python.org/mailman/li
Sean Hammond wrote:
> I've managed to create a scenario in which editing an object in a list of
> objects seems to edit every object in the list, rather than just the one.
> I'm totally stumped and wondered if anyone would be kind enough to read my
> explanation and see if they have any suggestion
Sean Hammond wrote:
> class Area:
> def __init__(self, occupants = []):
>self.occupants = occupants
>
...
> I must be making some really stupid mistake, but this just doesn't
> look like the list behaviour I would expect. What's going on here?
Whenever you use the default value
Sean Hammond schrieb:
>
> I've managed to create a scenario in which editing an object in a list
> of objects seems to edit every object in the list, rather than just the
> one. I'm totally stumped and wondered if anyone would be kind enough to
> read my explanation and see if they have any sug
I've managed to create a scenario in which editing an object in a list of
objects seems to edit every object in the list, rather than just the one.
I'm totally stumped and wondered if anyone would be kind enough to read my
explanation and see if they have any suggestions. I have probably stumbl