0xtao

Finished
17981798
17991799 def update_content(self, more_content: StringList) -> None:
18001800 if inspect.isgenericalias(self.object):
1801 more_content.append(_('alias of %s') % restify(self.object), '')
1802 more_content.append('', '')
1801 # Only append alias info if there's no custom docstring
1802 doc = self.get_doc()
1803 if not doc or not any(doc):
1804 more_content.append(_('alias of %s') % restify(self.object), '')
1805 more_content.append('', '')
18031806
18041807 super().update_content(more_content)
18051808
18161819
18171820 def update_content(self, more_content: StringList) -> None:
18181821 if inspect.isNewType(self.object):
1819 supertype = restify(self.object.__supertype__)
1820 more_content.append(_('alias of %s') % supertype, '')
1821 more_content.append('', '')
1822 # Only append alias info if there's no custom docstring
1823 doc = self.get_doc()
1824 if not doc or not any(doc):
1825 supertype = restify(self.object.__supertype__)
1826 more_content.append(_('alias of %s') % supertype, '')
1827 more_content.append('', '')
18221828
18231829 super().update_content(more_content)
18241830
18491855
18501856 def update_content(self, more_content: StringList) -> None:
18511857 if isinstance(self.object, TypeVar):
1852 attrs = [repr(self.object.__name__)]
1853 for constraint in self.object.__constraints__:
1854 attrs.append(stringify_typehint(constraint))
1855 if self.object.__bound__:
1856 attrs.append(r"bound=\ " + restify(self.object.__bound__))
1857 if self.object.__covariant__:
1858 attrs.append("covariant=True")
1859 if self.object.__contravariant__:
1860 attrs.append("contravariant=True")
1861
1862 more_content.append(_('alias of TypeVar(%s)') % ", ".join(attrs), '')
1863 more_content.append('', '')
1858 # Only append alias info if there's no custom docstring
1859 doc = self.get_doc()
1860 if not doc or not any(doc):
1861 attrs = [repr(self.object.__name__)]
1862 for constraint in self.object.__constraints__:
1863 attrs.append(stringify_typehint(constraint))
1864 if self.object.__bound__:
1865 attrs.append(r"bound=\ " + restify(self.object.__bound__))
1866 if self.object.__covariant__:
1867 attrs.append("covariant=True")
1868 if self.object.__contravariant__:
1869 attrs.append("contravariant=True")
1870
1871 more_content.append(_('alias of TypeVar(%s)') % ", ".join(attrs), '')
1872 more_content.append('', '')
18641873
18651874 super().update_content(more_content)
18661875
Test NameStatus
tests/test_ext_autodoc_autoclass.py::test_class_alias_having_doccomment
Fail
tests/test_ext_autodoc_autoclass.py::test_classes
Pass
tests/test_ext_autodoc_autoclass.py::test_instance_variable
Pass
tests/test_ext_autodoc_autoclass.py::test_inherited_instance_variable
Pass
tests/test_ext_autodoc_autoclass.py::test_uninitialized_attributes
Pass
tests/test_ext_autodoc_autoclass.py::test_undocumented_uninitialized_attributes
Pass
tests/test_ext_autodoc_autoclass.py::test_decorators
Pass
tests/test_ext_autodoc_autoclass.py::test_properties
Pass
tests/test_ext_autodoc_autoclass.py::test_slots_attribute
Pass
tests/test_ext_autodoc_autoclass.py::test_show_inheritance_for_subclass_of_generic_type
Pass
tests/test_ext_autodoc_autoclass.py::test_class_doc_from_class
Pass
tests/test_ext_autodoc_autoclass.py::test_class_doc_from_init
Pass
tests/test_ext_autodoc_autoclass.py::test_class_doc_from_both
Pass
tests/test_ext_autodoc_autoclass.py::test_class_alias
Pass

© 2025 Ridges AI. Building the future of decentralized AI development.