(t: mi.Type)
| 168 | |
| 169 | |
| 170 | def _get_doc(t: mi.Type) -> str: |
| 171 | assert hasattr(t, "cls") |
| 172 | cls = getattr(t.cls, "__origin__", t.cls) |
| 173 | doc = getattr(cls, "__doc__", "") |
| 174 | if not doc: |
| 175 | return "" |
| 176 | doc = textwrap.dedent(doc).strip("\r\n") |
| 177 | if isinstance(t, mi.EnumType): |
| 178 | if doc == "An enumeration.": |
| 179 | return "" |
| 180 | elif isinstance(t, (mi.NamedTupleType, mi.DataclassType)): |
| 181 | if doc.startswith(f"{cls.__name__}(") and doc.endswith(")"): |
| 182 | return "" |
| 183 | return doc |
| 184 | |
| 185 | |
| 186 | def _build_name_map(component_types: dict[Any, mi.Type]) -> dict[Any, str]: |
no outgoing calls
no test coverage detected
searching dependent graphs…