[Python-ideas] `numbers.Natural`

Ram Rachum ram at rachum.com
Fri Sep 26 20:13:03 CEST 2014


I agree with both the points you raised, they're both disadvantages. The
question is whether the uses would be worth these two disadvantages.
(`collections.Hashable` also has the second disadvantage you mentioned, and
it's still in the stdlib, so there's hope.)

On Fri, Sep 26, 2014 at 9:10 PM, Thomas Gläßle <t_glaessle at gmx.de> wrote:

>  At first glance it sounds nice and straight forward.
> But - is a natural positive, or just non-negative? I guess, I'd have to
> look it up in the docs each time, since either definition is used in lots
> of places.
> Also, Natural does not correspond to the python type, but its value. So,
> you couldn't use it with issubclass.
>
>
> Ram Rachum wrote on 09/26/2014 07:54 PM:
>
> I wish the `numbers` module would include a `Natural` class that would
> simply check whether the number is integral and positive.
>
>
> _______________________________________________
> Python-ideas mailing listPython-ideas at python.orghttps://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140926/0abd0e0a/attachment.html>


More information about the Python-ideas mailing list