Sylvain Marié

Results 299 comments of Sylvain Marié

Thanks @PrettyWood !

Each class in python already has a magic method `__subclasses__()` able to list all the known subclasses (even the ones created dynamically). So it is definitely possible, the issue is...

```python from typing import TypeVar, Generic T = TypeVar('T') U = TypeVar('U') class FullUnparam(Generic[T, U]): pass class FullUnparam2(FullUnparam): pass class HalfParam(FullUnparam[T, int]): pass class EntirelyParam(FullUnparam[str, int]): pass class EntirelyParam2(HalfParam[str]): pass...

Thanks for the fast answer! Yes you're right, my example had a flaw, I fixed it directly in the initial post: I added another class `EntirelyParam2` and updated the tests....

Note that strictly speaking, `EntirelyParam2` is not a subclass of `FullUnparam` (and even not of `HalfParam`, even that appears correctly in the results) because it is not a subclass of...

I opened a mirror issue in `typing_inspect` so that @ilevkivskyi may check if he feels that this should rather go in the low-level api

My attempt, recursing on subclasses because it sems that `__subclasses__()` is not recursive: ```python def get_all_subclasses(typ, recursive: bool = True, memo = None) -> List[Type[Any]]: """ Returns all subclasses, and...

Thanks for the help with is_subtype! The following method passes all core tests: ```python def get_all_subclasses(typ, recursive: bool = True, memo = None) -> List[Type[Any]]: memo = memo or set()...

Thanks ! * Yes `is_generic_type` and `get_origin` are from `typing_inspect`, as you figured out. * "Filtering them out would mean to only include origins in the result?" > Yes, I...

Argh, that explains a lot of things, thanks for investigating and finding this out! Here is a synthetic view of the relations between the classes (I hope that the display...