Skip to content

Members not listed for ABC-derived classes with custom metaclass #132

@pkgw

Description

@pkgw

This issue is an iteration on #52 / #53. Members of a class fail to be listed when the following circumstances hold:

  • You're on Python 3
  • :inherited-members: is not in effect
  • The class inherits from abc.ABC
  • None of its superclasses override __slots__
  • The class has a metaclass that is not abc.ABCMeta

Sounds incredibly esoteric, but this is biting me in wwt_data_formats right now.

The problem is that the fix for the earlier bug, #53, only tests if the metaclass of the class in question is exactly ABCMeta. If the class uses a custom metaclass that derives from ABCMeta, the check fails. For example:

from abc import ABC, ABCMeta

class IntermediateMeta(ABCMeta):
    pass

class Concrete(ABC, metaclass=IntermediateMeta):
    def mymethod(self):
        """This is a great method."""
        pass

The fix is a one-liner, and I'll submit a PR momentarily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions