Skip to content

[types] Make MethodType generic - #16586

Draft
srittau wants to merge 2 commits into
python:mainfrom
srittau:generic-method-type
Draft

srittau wants to merge 2 commits into
python:mainfrom
srittau:generic-method-type

Conversation

@srittau

@srittau srittau commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

This is a re-do of #15993, which currently (as of Pyrefly 1.4.0) crashes pyrefly.


Deferred, until meta/pyrefly#5325, which is a fix for meta/pyrefly#5308 makes it into a release. (Probably 1.5.0.)

@srittau
srittau marked this pull request as draft October 21, 2026 08:56
@srittau srittau added the status: deferred Issue or PR deferred until some precondition is fixed label Oct 21, 2026
@github-actions

This comment has been minimized.

@srittau

srittau commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed in meta/pyrefly#5325.

@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pydantic (https://github.com/pydantic/pydantic)
- pydantic/experimental/arguments_schema.py:41: error: Argument 1 to "_arguments_schema" of "GenerateSchema" has incompatible type "Callable[..., Any]"; expected "FunctionType | MethodType | partial[Any]"  [arg-type]
+ pydantic/experimental/arguments_schema.py:41: error: Argument 1 to "_arguments_schema" of "GenerateSchema" has incompatible type "Callable[..., Any]"; expected "FunctionType | MethodType[[VarArg(Any), KwArg(Any)], Any] | partial[Any]"  [arg-type]
- pydantic/experimental/arguments_schema.py:43: error: Argument 1 to "_arguments_v3_schema" of "GenerateSchema" has incompatible type "Callable[..., Any]"; expected "FunctionType | MethodType | partial[Any]"  [arg-type]
+ pydantic/experimental/arguments_schema.py:43: error: Argument 1 to "_arguments_v3_schema" of "GenerateSchema" has incompatible type "Callable[..., Any]"; expected "FunctionType | MethodType[[VarArg(Any), KwArg(Any)], Any] | partial[Any]"  [arg-type]

This branch has not been deployed

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

Labels

status: deferred Issue or PR deferred until some precondition is fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant