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

2018年6月22日 09:44:40 -0700

On Fri, Jun 22, 2018 at 08:13:44AM -0700, Guido van Rossum wrote:
> Honestly it looks to me like the status quo is perfect.
Does this example work for you?
py> (17.1).hex == (17.1).hex
True
But:
py> a = 17.1
py> b = 17.1
py> a.hex == b.hex
False
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.
-- 
Steve
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to