8000 inspect.signature() raises TypeError for non-comparable callable · Issue #118404 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
serhiy-storchaka opened this issue Apr 29, 2024 · 0 comments
Closed
Labels
3.12 only security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member
serhiy-storchaka commented Apr 29, 2024

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

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 30, 2024
…pythonGH-118405)

(cherry picked from commit 11f8348)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Apr 30, 2024
GH-118405) (GH-118424)

(cherry picked from commit 11f8348)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant
0