C API eqivalent of object.__new__

Jacek Generowicz jacek.generowicz at cern.ch
Fri Oct 1 03:22:26 EDT 2004


How would one write object._new__(SomeType) in the C API ?

... and what lies behind the following behaviour:

  >>> object.__new__(T)
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  TypeError: object.__new__(T) is not safe, use T.__new__()

where T refers to almost any fundamental Python type ?



More information about the Python-list mailing list