Re: c[:]()
On 2007-05-31, Steve Holden <steve@holdenwe b.comwrote:
>
It isn't. The OP is projecting a wish for a function call on a
list to be interpreted as a call on each member of the list
with the same arguments.
Yea, I got that part.
That's what I thought, but the OP seems convinced that c[:] is
somehow behaviorally different than c (something more than just
being an exact copy of the list with a different id()).
The only thing I could think of is that he has overridden the
__getitem__ method of the class to which c belongs with
something that has some sort of side-effects which he wishes to
invoke.
He could just define a container class that does what he
wants...
--
Grant Edwards grante Yow! Mr and Mrs PED, can I
at borrow 26.7% of the RAYON
visi.com TEXTILE production of the
INDONESIAN archipelago?
On 2007-05-31, Steve Holden <steve@holdenwe b.comwrote:
>I still don't see how c[:] is any different from c.
It isn't. The OP is projecting a wish for a function call on a
list to be interpreted as a call on each member of the list
with the same arguments.
The all-members slice notation is a complete red herring.
somehow behaviorally different than c (something more than just
being an exact copy of the list with a different id()).
The only thing I could think of is that he has overridden the
__getitem__ method of the class to which c belongs with
something that has some sort of side-effects which he wishes to
invoke.
It would require a pretty fundamental re-think to give such a
construct sensible and consistent semantics, I think.
construct sensible and consistent semantics, I think.
wants...
--
Grant Edwards grante Yow! Mr and Mrs PED, can I
at borrow 26.7% of the RAYON
visi.com TEXTILE production of the
INDONESIAN archipelago?
Comment