These are chat archives for dropbox/pyston

31st
Mar 2016
Vinzenz Feenstra
@vinzenz
Mar 31 2016 08:19
@kmod Well, Python 3 allows that, however won't create a new type, in Python 2.7 it raises a typeerror
Python 3.5.0 (default, Sep 23 2015, 04:41:38) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> type(None).__new__(type(None))
>>> x = type(None).__new__(type(None))
>>> id(x)
4309217720
>>> id(None)
4309217720
>>> 
Python 2.7.11 (default, Jan 22 2016, 08:29:18) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = type(None).__new__(type(None))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object.__new__(NoneType) is not safe, use NoneType.__new__()
>>> 
Kevin Modzelewski
@kmod
Mar 31 2016 16:25
oh interesting