Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105563 > unrolled thread

Re: 0 equals False, was Re: (unknown)

Started byTerry Reedy <tjreedy@udel.edu>
First post2016-03-23 14:00 -0400
Last post2016-03-23 14:00 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: 0 equals False, was Re: (unknown) Terry Reedy <tjreedy@udel.edu> - 2016-03-23 14:00 -0400

#105563 — Re: 0 equals False, was Re: (unknown)

FromTerry Reedy <tjreedy@udel.edu>
Date2016-03-23 14:00 -0400
SubjectRe: 0 equals False, was Re: (unknown)
Message-ID<mailman.62.1458756067.2244.python-list@python.org>
On 3/23/2016 4:51 AM, Peter Otten wrote:

> The pythonic solution is "don't do this". The == operator cannot
> discriminate between 0, 0.0, and False,

and 0j and Fraction(0, 1) and Decimal(0)

> or 1, 1.0, and True

and 1+0j, Fraction(1, 1) and Decimal(1)

Sets and dicts are based both based on (transitive) equality.

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web