]> granicus.if.org Git - python/commit
SF bug #475327: type() produces incorrect error msg
authorTim Peters <tim.peters@gmail.com>
Sat, 27 Oct 2001 19:37:48 +0000 (19:37 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 27 Oct 2001 19:37:48 +0000 (19:37 +0000)
commit3abca127fe1565ec80f6b0a1ae48d65186ad887d
treead9da6a32fe9956cba5d804939f345b85ad85259
parent4d85953fe609197c54827826963eabaf6418024c
SF bug #475327:  type() produces incorrect error msg

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.
Include/object.h
Objects/typeobject.c