Skip to content

Builtin function's class object return wrong value for attribute __module__ __doc__ #2310

Closed
@qingshi163

Description

@qingshi163

While I am working on the pickle for iterator object, I went into the unexpected throw from pickle.py. After reading the source I find out that because it need the module name from the pickled object's class but module return a getset_descriptor instead a str.

Put it simple, the following code cause the issue:

import builtins
builtins.iter.__class__.__module__
builtins.iter.__class__.__doc__

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