[Patches] [ python-Patches-560250 ] isinstance error message
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 27 May 2002 07:33:02 -0700
Patches item #560250, was opened at 2002-05-24 19:51
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=560250&group_id=5470
Category: Core (C code)
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: isinstance error message
Initial Comment:
isinstance now accepts a tuple containing classes
and/or types as second argument.
The patch abstract.diff implements a better error
message:
isinstance arg 2 must be a class, type or tuple of
classes and types
instead of
isinstance arg 2 must be a class or type
----------------------------------------------------------------------
>Comment By: Thomas Heller (theller)
Date: 2002-05-27 16:33
Message:
Logged In: YES
user_id=11105
I've attached a new patch.
----------------------------------------------------------------------
Comment By: Thomas Heller (theller)
Date: 2002-05-27 16:31
Message:
Logged In: YES
user_id=11105
Right.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-05-27 15:33
Message:
Logged In: YES
user_id=21627
Isn't there a komma missing between "type" and "or"?
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2002-05-24 20:28
Message:
Logged In: YES
user_id=33168
Sorry about that, 2.1.x was the last version where the
docstring didn't have tuple.
Patch looks good to me.
----------------------------------------------------------------------
Comment By: Thomas Heller (theller)
Date: 2002-05-24 20:20
Message:
Logged In: YES
user_id=11105
The doc-string seems ok. Here is it from 2.2.1:
isinstance(object, class-or-type-or-tuple) -> Boolean
Return whether an object is an instance of a class or of a
subclass thereof.
With a type as second argument, return whether that is the
object's type.
The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut
for
isinstance(x, A) or isinstance(x, B) or ... (etc.).
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2002-05-24 20:18
Message:
Logged In: YES
user_id=33168
We should update the docstring too.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=560250&group_id=5470