Skip to content

Conversation

@kiranandcode
Copy link
Contributor

This PR fixes method call templates, closes #462

A couple of changes:

try:
  hints = get_type_hints(obj)
except Exception:
    ...

was always raising exceptions for Templates with the exception inspect not found. I could make it work by specifying globalns=globals() but then the returned hints dictionary was not the signature, but the signature of the template itself?

There is no reliable way to detect method templates, in this case, if the first parameter is named self, we drop it, thereby restoring ability for method calls to work.

@kiranandcode kiranandcode requested a review from jfeser December 26, 2025 19:01
Copy link
Contributor

@eb8680 eb8680 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct in general and is superceded by the changes in #424

@kiranandcode
Copy link
Contributor Author

@eb8680 Sounds good. I mainly added this PR to be able to implement #464. Closing this, once #424 is merged, hopefully method calls will work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants