Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74676
| References | (3 earlier) <CAPM-O+yiioLm-UiV2fYqc2n9qZrN+_v6RkeqJ7mOQ3Kq+cH0CQ@mail.gmail.com> <mailman.11716.1404946997.18130.python-list@python.org> <osx38e010kj.fsf@gmail.com> <mailman.11929.1405611387.18130.python-list@python.org> <osxwqbbzuqc.fsf@gmail.com> |
|---|---|
| Date | 2014-07-18 04:59 +1000 |
| Subject | Re: NaN comparisons - Call For Anecdotes |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11951.1405623598.18130.python-list@python.org> (permalink) |
On Fri, Jul 18, 2014 at 4:49 AM, Johann Hibschman <jhibschman@gmail.com> wrote:
> In
> principle, (NA == 1.0) should be a NA (missing) truth value, as should
> (NA == NA), but in practice having it be False is more useful.
This is actually fairly easily implemented, if you ever want it.
class NAType:
def __repr__(self): return "NA"
def __eq__(self, other): return self
__lt__ = __gt__ = __le__ = __ge__ = __ne__ = __eq__
NA = NAType()
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-10 01:03 +0200
Re: NaN comparisons - Call For Anecdotes Johann Hibschman <jhibschman@gmail.com> - 2014-07-17 11:12 -0400
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-18 01:36 +1000
Re: NaN comparisons - Call For Anecdotes Johann Hibschman <jhibschman@gmail.com> - 2014-07-17 14:49 -0400
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-18 04:55 +1000
Re: NaN comparisons - Call For Anecdotes Marko Rauhamaa <marko@pacujo.net> - 2014-07-17 22:10 +0300
Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-17 14:39 -0600
Re: NaN comparisons - Call For Anecdotes Marko Rauhamaa <marko@pacujo.net> - 2014-07-18 00:08 +0300
Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-17 17:00 -0600
Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-17 17:07 -0600
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-18 04:59 +1000
Re: NaN comparisons - Call For Anecdotes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-18 17:57 +0000
Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-19 05:49 +1000
csiph-web