Bug or feature?

Terry Reedy tjreedy at udel.edu
Fri Jan 16 14:54:21 EST 2004


"Jp Calderone" <exarkun at intarweb.us> wrote in message
news:mailman.433.1074267521.12720.python-list at python.org...
> On Fri, Jan 16, 2004 at 08:31:32AM +0000, Dennis Lee Bieber wrote:
> > Terry Reedy fed this fish to the penguins on Thursday 15 January 2004
> > 15:39 pm:
> >
> > >
> > > and returning a value.  I see a little better Guido's reason for
having
> > > list modification methods return None.  While chaining is not too
> > > problematical, object returns would allow list expressions mixing
> > > implicit and overt effects with possible puzzles similar to the one
> > > presented in this thread.

> >         Now that you mention it... Yeah... Can you imagine trying to
figure
> > out what something like...

>http://python.org/doc/current/ref/evalorder.html
>   Doesn't seem to be a problem, after all.

Not for you, but how about newbie and others who don't read or ignore,
misunderstand, or reject what they read?  Lets try this example based on
OP's real examples.  Again, hypothetical, assuming list mutators were to
return list.

l3 = range(3)
l3+l3.reverse()
# I believe that this wouldbe [1,2,3,3,2,1]
l3 = range(3)
tem = l3.reverse()
l3 + tem
# I believe that this would  instead be [3,2,1,3,2,1]

I am sure that were such things legal, there would be numerous posts
complaining about 'unexpected' outcomes.  Hence my comment about their not
being legal being good.

OP believe that getting a different answer when inserting a tempory in the
midst of a side-effect dependent expression is such a problem that we
should break code to 'fix' it.   I obviously disagree.

Terry J. Reedy





More information about the Python-list mailing list