Skip to content

types.MemberDescriptorType docs should mention it is used for __slots__ #108731

@plokmijnuhby

Description

@plokmijnuhby

The documentation for types.MemberDescriptorType in the types module indicate that it is used in extension modules. This is true, but fails to mention the other common use of the class, as the type of a slot.
For those who aren't aware, if we define a class like so:

class Foo:
    __slots__ = ('bar',)

then it will create an attribute bar on the class. Calling type(Foo.bar) will return types.MemberDescriptorType.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixesdocsDocumentation in the Doc direasy

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions