Skip to content

Borrowed<PyType>::name is not consistent #4055

@wyfo

Description

@wyfo

With #[cfg(not(any(Py_LIMITED_API, PyPy)))], Borrowed<'a, '_, PyType>::name implementation delegates to tp_name.
However, tp_name is not consistent.
For pure Python types Borrowed<'a, '_, PyType>::name returns different result if compiled with or without abi3 feature.

Solution

Make Borrowed<'a, '_, PyType>::name follow __name__ behavior, and expose Borrowed<'a, '_, PyType>::module.

I will open a PR.

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