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/2013-April/125578.html below:

[Python-Dev] NoneType(None) raises exception

[Python-Dev] NoneType(None) raises exceptionDevin Jeanpierre jeanpierreda at gmail.com
Fri Apr 26 04:25:02 CEST 2013
On Thu, Apr 25, 2013 at 9:12 PM, MRAB <python at mrabarnett.plus.com> wrote:
>> Only when you write it out like that as constants. It's no more,
>> or less, strange than str('spam') or int(1) or list([]). Why
>> would you do that?
>>
> None is a singleton, but instances of str, int, list, etc aren't. Why
> can it take an argument when there's only ever one of them?
>
> That's why it seems strange to me.

How about bool? False and True are singletons much like None is, and
bool(False) == False; bool(True) == True.

Sure the distinction is that all of those are useful as conversion
functions, whereas NoneType would never be used that way.

-- Devin
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