Skip to content

[types] Make MethodType generic - #16586

Draft
srittau wants to merge 1 commit into
python:mainfrom
srittau:generic-method-type
Draft

srittau wants to merge 1 commit 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 crashed pyrefly.


Deferred, until facebook/pyrefly#5325, which is a fix for facebook/pyrefly#5308 makes it into a release.

@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

Copy link
Copy Markdown
Contributor

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

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/_epub_base.py:34:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

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]

@srittau

srittau commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed in facebook/pyrefly#5325.

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