(cls: Type[_T])
| 168 | |
| 169 | |
| 170 | def walk_subclasses(cls: Type[_T]) -> Iterator[Type[_T]]: |
| 171 | seen: Set[Any] = set() |
| 172 | |
| 173 | stack = [cls] |
| 174 | while stack: |
| 175 | cls = stack.pop() |
| 176 | if cls in seen: |
| 177 | continue |
| 178 | else: |
| 179 | seen.add(cls) |
| 180 | stack.extend(cls.__subclasses__()) |
| 181 | yield cls |
| 182 | |
| 183 | |
| 184 | def string_or_unprintable(element: Any) -> str: |