This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author izbyshev
Recipients izbyshev, jab, levkivskyi, methane, serhiy.storchaka
Date 2018-03-08.14:30:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520519446.34.0.467229070634.issue33018@psf.upfronthosting.co.za>
In-reply-to
Content
> Isn't it just a limitation?
> Most Python-implemented objects supports weakref. I don't think "requiring weakref support implies it must be type object".

Formally, there is no implication. It is the abc module authors who know the truth. But I can't imagine why anybody would impose such a limitation by design, because while instances of user-defined classes support weakrefs, built-in classes used by everybody like tuple, list and dict don't. That's why I guessed that non-types were not meant to be supported.

> What "by OP" means?
OP = Original poster (@jab).

> I can't find `if not issubclass(cls, type): raise TypeError` in Reversible implementation.
> They do duck-typing, same to ABC.

Sorry for being unclear. There is no explicit check as you say, but __mro__ is directly accessed (see msg313376). But it may probably be considered "duck typing" too.

> But I don't know much about how mages use ABC.  I need mages comment before merging the pull request.
Totally agree.

> BTW, do you think it should be backported to 3.7, or even 3.6?
3.7 certainly has my vote -- this can hardly be considered a new feature.

For 3.6, I'd listen to ABC users/experts. Might raising a TypeError instead of returning False from issubclass(user_defined_obj, ABC) break something important? Personally, I think it would mostly expose bugs and not hinder reasonable usage.  

> Can https://github.com/python/cpython/commit/fc7df0e664198cb05cafd972f190a18ca422989c be reverted?

Seems like it can, but the test should survive in some form :)
History
Date User Action Args
2018-03-08 14:30:46izbyshevsetrecipients: + izbyshev, jab, methane, serhiy.storchaka, levkivskyi
2018-03-08 14:30:46izbyshevsetmessageid: <1520519446.34.0.467229070634.issue33018@psf.upfronthosting.co.za>
2018-03-08 14:30:46izbyshevlinkissue33018 messages
2018-03-08 14:30:46izbyshevcreate