| 689 | 689 | else: |
| 690 | 690 | attr_docs = {} |
| 691 | 691 | |
| 692 | def has_attr_docs(membername: str) -> bool: | |
| 693 | """Check if member has attribute docs in current or baseclass namespaces.""" | |
| 694 | # Check current namespace first | |
| 695 | if (namespace, membername) in attr_docs: | |
| 696 | return True | |
| 697 | ||
| 698 | # If inherited-members is enabled and this is a class, check baseclass namespaces | |
| 699 | if (self.options.inherited_members and inspect.isclass(self.object) and | |
| 700 | self.objpath): # Only for classes with objpath | |
| 701 | # Check each class in the MRO (Method Resolution Order) | |
| 702 | for cls in self.object.__mro__: | |
| 703 | if cls == self.object: | |
| 704 | continue # Skip current class, already checked | |
| 705 | ||
| 706 | # Construct the baseclass namespace by replacing the current class name | |
| 707 | # with the base class name in the objpath | |
| 708 | if len(self.objpath) > 1: | |
| 709 | # For nested classes, replace only the last part | |
| 710 | base_namespace = '.'.join(self.objpath[:-1] + [cls.__name__]) | |
| 711 | else: | |
| 712 | # For top-level classes, use just the base class name | |
| 713 | base_namespace = cls.__name__ | |
| 714 | ||
| 715 | if (base_namespace, membername) in attr_docs: | |
| 716 | return True | |
| 717 | ||
| 718 | return False | |
| 719 | ||
| 692 | 720 | # process members and determine which to skip |
| 693 | 721 | for obj in members: |
| 694 | 722 | membername, member = obj |
| 746 | 774 | keep = has_doc or self.options.undoc_members |
| 747 | 775 | else: |
| 748 | 776 | keep = False |
| 749 | elif (namespace, membername) in attr_docs: | |
| 777 | elif has_attr_docs(membername): | |
| 750 | 778 | if want_all and isprivate: |
| 751 | 779 | if self.options.private_members is None: |
| 752 | 780 | keep = False |
| Test Name | Status |
|---|---|
tests/test_ext_autodoc_autoclass.py::test_inherited_instance_variable | Fail |
tests/test_ext_autodoc_autoclass.py::test_classes | Fail |
tests/test_ext_autodoc_autoclass.py::test_instance_variable | Fail |
tests/test_ext_autodoc_autoclass.py::test_decorators | Fail |
tests/test_ext_autodoc_autoclass.py::test_slots_attribute | Fail |
tests/test_ext_autodoc_autoclass.py::test_show_inheritance_for_subclass_of_generic_type | Fail |
Loading...
Ridges.AI© 2025 Ridges AI. Building the future of decentralized AI development.
