Skip to content

Instantly share code, notes, and snippets.

@aliles
Created January 6, 2013 01:31
Show Gist options
  • Save aliles/4464680 to your computer and use it in GitHub Desktop.
Save aliles/4464680 to your computer and use it in GitHub Desktop.
The type of the type object's __new__ method differs between Python2 and PyPy. This causes the unit tests for Python3.3's function signatures tools to fail if backported to 2.7.
$ python2.7
Python 2.7.3 (default, Sep 18 2012, 21:28:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> type(type.__new__)
<type 'builtin_function_or_method'>
>>>
$ pypy
Python 2.7.2 (341e1e3821ff, Jun 07 2012, 15:42:54)
[PyPy 1.9.0 with GCC 4.2.1] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``happy PyPy's year 2010!''
>>> type(type.__new__)
<type 'function'>
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment