[Python-Dev] About [].append == [].append

Steven D'Aprano steve at pearwood.info
Fri Jun 22 21:50:39 EDT 2018


On Fri, Jun 22, 2018 at 11:44:07AM -0700, Guido van Rossum wrote:
[...]
> > I know why it happens -- at the REPL, the interpreter uses the same
> > object for both 17.1 instances when they're part of the same statement,
> > but not when they're on separate lines. I just don't know whether this
> > is desirable or not.
> >
> 
> But there's nothing new about that example. It's just the same as the issue
> that sometimes `1 is 1` and sometimes it isn't.

Sure, but this is closer to "sometimes 1 == 1 and sometimes it isn't". 
But if you're okay with it, I don't have a counter-argument.

I think it is more important that builtin methods and Python methods 
behave the same. Should Python methods be changed to compare self with 
"is" or are we too late to make that change?



-- 
Steve


More information about the Python-Dev mailing list