[Python-ideas] An Everything singleton
Westley MartÃnez
anikom15 at gmail.com
Wed Feb 19 07:05:49 CET 2014
Is there a strong use case for this? How did this idea come about?
On Feb 18, 2014 11:08 AM, "Serhiy Storchaka" <storchaka at gmail.com> wrote:
>
> This crazy idea is inspired by a discussing in Python-Dev which should be
here.
>
> Currently we have a None singleton which representing nothing and raises
an exception in almost all operations (except equality, etc). What about
introducing its antonym, an Everything singleton (the name is discussable),
which newer raises an exception in any operation, but returns consistent
value?
>
> >>> Everything + 2
> 2
> >>> Everything < 3
> True
> >>> Everything * 'foo'
> 'foo'
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://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/20140218/a6b55274/attachment.html>
More information about the Python-ideas
mailing list