[issue18737] Get virtual subclasses of an ABC

Antoine Pitrou report at bugs.python.org
Wed Aug 14 17:54:55 CEST 2013


Antoine Pitrou added the comment:

> I like to do something similar to marker interfaces [1] with ABCs.
> For introspection and documentation I need a way to get all
> non-abstract classes that are implemented by an ABC.

You mean that implement an ABC? But you also need to return real
subclasses that implement the ABC (e.g. UserDict in the example above).

> How about I change the implementation to get_subclasses(direct=False)
> to return all virtual and real subclasses of an ABC? I can filter
> out abstract types with inspect.isabstract() later.

Sounds ok.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18737>
_______________________________________


More information about the Python-bugs-list mailing list