[Patches] [ python-Patches-649608 ] tuple arg for issubclass
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 07 Dec 2002 00:42:19 -0800
Patches item #649608, was opened at 2002-12-06 17:32
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=649608&group_id=5470
Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: tuple arg for issubclass
Initial Comment:
The following patch enhances issubclass(), so that it's
possible to pass a tuple as the second argument. This
has the same meaning as for isinstance(): the first
argument will be checked against each entry in the tuple.
The patch works somewhat differently than isinstance,
because for isinstance, a tuple argument is unpacked
recursively, this patch doesn't do this, instead any
entry in the tuple that isn't a class raises a TypeError.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-12-07 09:42
Message:
Logged In: YES
user_id=21627
-1. I find this confusing: one may expect that issubclass(a,
(b,c)) is true iff a is a subclass of both b and c. In the
face of ambiguity, refuse the temptation to guess.
What is the rationale for this feature, apart from symmetry
with isinstance?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=649608&group_id=5470