Extension method for python built-in types

It can be done in pure Python with this incredibly clever module: https://pypi.python.org/pypi/forbiddenfruit For example: import functools import ctypes import __builtin__ import operator class PyObject(ctypes.Structure): pass Py_ssize_t = hasattr(ctypes.pythonapi, ‘Py_InitModule4_64’) and ctypes.c_int64 or ctypes.c_int PyObject._fields_ = [ (‘ob_refcnt’, Py_ssize_t), (‘ob_type’, ctypes.POINTER(PyObject)), ] class SlotsPointer(PyObject): _fields_ = [(‘dict’, ctypes.POINTER(PyObject))] def proxy_builtin(klass): name = klass.__name__ slots = … Read more