]> granicus.if.org Git - python/commit
Replace BadInternalCall with TypeError. Add a test case. Fix whitespace.
authorRaymond Hettinger <python@rcn.com>
Wed, 4 Dec 2002 07:32:25 +0000 (07:32 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 4 Dec 2002 07:32:25 +0000 (07:32 +0000)
commitb02bb5ed0a45571c3be195cd053bb28e408a99cd
treed42cba22585a0e578fb78e1473bf377a398891b3
parent21d77f5e9cd77c4fb45038ed778306a1ec4ecfb9
Replace BadInternalCall with TypeError.  Add a test case.  Fix whitespace.

Just van Rossum showed a weird, but clever way for pure python code to
trigger the BadInternalCall.  The C code had assumed that calling a class
constructor would return an instance of that class; however, classes that
abuse __new__ can invalidate that assumption.
Lib/test/test_types.py
Objects/dictobject.c