Skip to content
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

Bug: CallableView on builtins/enums #42

Open
4 tasks
DanCardin opened this issue Oct 5, 2024 · 0 comments
Open
4 tasks

Bug: CallableView on builtins/enums #42

DanCardin opened this issue Oct 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DanCardin
Copy link
Collaborator

Description

Many native builtins implemented in C do not have native signatures. Thus when we call inspect.signature is yields a ValueError. Seems like these cases e.g. boolshould probably be falling back to inspectingfn.call`

enum.Enum implementations raise AttributeError because cls.__signature__ is pre-populated with a callable method who's purpose eludes me but apparently inspect.signature gained support for dealing with at some point, because there was a bug report about it.

We could do something to the effect of

        signature = getattr(fn, "__signature__", None)
        if signature is None or inspect.ismethod(signature):
            self.signature = inspect.signature(fn)
        else:
            self.signature = signature

because i think this case is actually just a weird enum-specific nonsense special case.

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

"In the format of: ![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

No response

Package Version

latest

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)
@DanCardin DanCardin added the bug Something isn't working label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant