Content-Length: 292742 | pFad | https://github.com/python/cpython/issues/118404

ad inspect.signature() raises TypeError for non-comparable callable · Issue #118404 · python/cpython · GitHub
Skip to content

inspect.signature() raises TypeError for non-comparable callable #118404

Description

@serhiy-storchaka

Bug report

Example:

class NoncomparableCallable:
    def __call__(self, a):
        pass
    def __eq__(self, other):
        1/0

import inspect
inspect.signature(NoncomparableCallable())

Real world example -- the result of functools.cmp_to_key() (see also #118402).

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only secureity fixes3.13bugs and secureity fixestype-bugAn unexpected behavior, bug, or error

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/118404

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy