Decide if `type.__subclasses__` is part of future Python or not
Greetings,
Currently `type.__subclasses__` is not documented at docs.python.org (and
works in both python 2 & python 3).
I would like to keep `.__subclasses__` and have it documented at
docs.python.org.
Is there a reason it is not documented?
I realize the whole type system is going an overhaul, and the concept of
what is "subclass" of another class is a complicated issue.
See for example: https://github.com/python/typing/issues/135 which talks
about the complexity of deciding subclassing.
I think though, despite the overall, `types.__subclasses__` should be kept
& documented.
Thanks,
Joy Diamond.
1. The google search: "site:docs.python.org __subclasses__" finds no
instances of the word "__subclasses__"
2. As for what the function does, it returns the subclasses of a class:
Consider the following program:
class CryptographicActors(object): pass
class Alice(CryptographicActors): pass
class Bob(CryptographicActors): pass
print("CryptographicActors subclases: %s" %
CryptographicActors.__subclasses__())
help(CryptographicActors.__subclasses__)
3. It properly prints out:
CryptographicActors subclases: [
participants (4)
-
Guido van Rossum
-
Joy Diamond
-
Serhiy Storchaka
-
Terry Reedy