[Patches] [Patch #102681] issubclass() and isinstance() error messages

noreply@sourceforge.net noreply@sourceforge.net
Fri, 12 Jan 2001 08:06:17 -0800


Patch #102681 has been updated. 

Project: python
Category: core (C code)
Status: Closed
Submitted by: ping
Assigned to : gvanrossum
Summary: issubclass() and isinstance() error messages

Follow-Ups:

Date: 2001-Jan-12 08:06
By: gvanrossum

Comment:
I've checked in a slightly modified version of this.

I fixed the errors in abstract_issubclass() to say that arg 1 or arg 2 must
be a class, not mentioning the possibility that it could be a type -- in
fact, a type isn't allowed (unless it has __bases__).

I also changed builtin_isinstance() so that it doesn't override the error
from abstract_issubclass() unless it' a TypeError (theoretically it could
raise a MemoryError too).
-------------------------------------------------------

Date: 2001-Jan-04 18:41
By: gvanrossum

Comment:
Ping, please answer my question!
-------------------------------------------------------

Date: 2000-Dec-06 04:08
By: ping

Comment:
This small patch makes the error messages from
issubclass() and isinstance() more descriptive.
It also contains a couple of tiny fixes to other
docstrings in bltinmodule.c.
-------------------------------------------------------

Date: 2000-Dec-06 09:53
By: fdrake

Comment:
Looks good, check it in!
-------------------------------------------------------

Date: 2000-Dec-06 09:56
By: gvanrossum

Comment:
Ping, are you sure that adding the function name to the error message
doesn't break the support for ExtensionClasses? abstract_issubclass() is
also called from isinstance().

I do agree with your docstring grammar changes! I've always thought that
the correct phrasing is "Return this-or-that", not "Return*s* this-or-that".
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102681&group_id=5470