A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/023661.html below:

[Python-Dev] Making None a keyword

[Python-Dev] Making None a keyword [Python-Dev] Making None a keywordPatrick K. O'Brien pobrien@orbtech.com
Fri, 26 Apr 2002 12:11:12 -0500
[Guido van Rossum]
>
> Nothing would change.  None would be a literal keyword, but its value
> in an expression would be the same as before, so None.__class__ would
> work.  Compare "foo".__class__.

>>> ''.__class__
<type 'str'>
>>> [].__class__
<type 'list'>
>>> {}.__class__
<type 'dict'>
>>> True.__class__
<type 'int'>
>>> 2.__class__
  File "<input>", line 1
    2.__class__
              ^
SyntaxError: invalid syntax
>>> 2.2.__class__
<type 'float'>
>>> 2L.__class__
<type 'long'>
>>>

Looks like int is one of the few literals that doesn't allow this. But
floats and longs do. Hmmm. Just FYI. ;-)

---
Patrick K. O'Brien
Orbtech





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