Antoine Pitrou added the comment:

> It's called get_VIRTUAL_subclasses() for a reason. You can get the
> real subclasses of an ABC with standard tool, e.g. recurse into
> __subclasses__().

What use case are you trying to solve? If I want to find out all classes
which implement an ABC, I don't care whether they implement it "virtually"
or not. OTOH, I do care that the results are stable and reliable, i.e.
that they don't change when someone changes from virtual inheritance to
real inheritance as an implementation detail.

For comparison, issubclass() doesn't make a difference between real and
virtual subclasses, or direct and recursive.

> For virtual subclasses you have to deal with the
> internals like _abc_registry. I could implement all four cases:
> recurse True/False, only virtual True/False.

I don't care about all four cases. What I'm saying is that only
"recurse=True, only virtual=False" makes sense from an user's POV.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18737>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to