• Tim Peters's avatar
    SF bug #475327: type() produces incorrect error msg · 3abca127
    Tim Peters authored
    object.h:  Added PyType_CheckExact macro.
    
    typeobject.c, type_new():
    
    + Use the new macro.
    + Assert that the arguments have the right types rather than do incomplete
      runtime checks "sometimes".
    + If this isn't the 1-argument flavor() of type, and there aren't 3 args
      total, produce a "types() takes 1 or 3 args" msg before
      PyArg_ParseTupleAndKeywords produces a "takes exactly 3" msg.
    3abca127
object.h 24.2 KB