A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-July/135369.html below:

[Python-Dev] == on object tests identity in 3.x

[Python-Dev] == on object tests identity in 3.xEthan Furman ethan at stoneleaf.us
Tue Jul 8 05:47:23 CEST 2014
On 07/07/2014 08:34 PM, Stephen J. Turnbull wrote:
> Ethan Furman writes:
>
>> And what would be this 'sensible definition' [of value equality]?
>
> I think that's the wrong question.  I suppose Andreas's point is that
> when the programmer doesn't provide a definition, there is no such
> thing as a "sensible definition" to default to.  I disagree, but given
> that as the point of discussion, asking what the definition is, is moot.

He eventually made that point, but until he did I thought he meant that there was such a sensible default definition, he 
just wasn't sharing what he thought it might be with us.


>> 2) The 'is' operator is specialized, and should only rarely be
>>    needed.
>
> Nitpick: Except that it's the preferred way to express identity with
> singletons, AFAIK.  ("if x is None: ...", not "if x == None: ...".)

Not a nit at all, at least in my code -- the number of times I use '==' far outweighs the number of times I use 'is'. 
Thus, 'is' is rare.

(Now, of course, I'll have to go measure that assertion and probably find out I am wrong :/ ).

--
~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4