Skip to content

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

Closed

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.12only security fixes
    3.13only security fixes
    on Apr 29, 2024
  2. added a commit that references this issue on Apr 29, 2024
  3. added a commit that references this issue on Apr 30, 2024
  4. added a commit that references this issue on Apr 30, 2024
  5. added a commit that references this issue on Apr 30, 2024
  6. added 2 commits that reference this issue on May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions