A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-April/063465.html below:

[Python-Dev] Should issubclass() be more like isinstance()?

[Python-Dev] Should issubclass() be more like isinstance()?Scott David Daniels Scott.Daniels at Acm.Org
Wed Apr 5 22:31:10 CEST 2006
Crutcher Dunnavant wrote:
> On 4/4/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> Crutcher Dunnavant wrote:
>>> B) issubclass() won't work on a list of classs,
>>  > the way isinstance() does.
>>
>> That sounds more reasonable. I can't think of any
>> reason why it shouldn't work.

There is an issue of confusion:

     class CheeseShop(Sketch, ByCleese, ByGraham): pass

You need to be careful that the user understands

     issubclass(SillyWalks, (Sketch, ByCleese, ByGraham))

is not simply testing that SillyWalks has the same ancestors as
CheeseShop, but is True simply because issubclass(SillyWalks, Sketch)
is True.  More a document issue than anything, but to be considered.

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4