Skip to content

Extract type parameters for bound methods.#40

Closed
dnwpark wants to merge 4 commits intomainfrom
eval-bound-method
Closed

Extract type parameters for bound methods.#40
dnwpark wants to merge 4 commits intomainfrom
eval-bound-method

Conversation

@dnwpark
Copy link
Contributor

@dnwpark dnwpark commented Jan 15, 2026

Allows eval_call on bound member functions.

@dnwpark dnwpark requested a review from msullivan January 15, 2026 21:21
Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

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

Is this worth doing fully like this?

We could do eval_call(C.invoke, C[int], 1) instead and get the same outcome without the method binding mechanism, right?

(Oh, though that would still require some different weird type var handling?)

# generic class, generic method
X = TypeVar("X")

class C(Generic[X]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the generic class syntax work? (class C[X]:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I just added tests to confirm this.

@dnwpark
Copy link
Contributor Author

dnwpark commented Jan 17, 2026

This PR extends the eval_call while continuing the assumption that all parameters are actual runtime values. The other PR is the one where I am trying to check things completely during static check time.

@dnwpark dnwpark closed this Feb 2, 2026
@dnwpark dnwpark deleted the eval-bound-method branch February 2, 2026 20:04
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.

2 participants