Skip to content

[ty] route constructor calls through bindings#22124

Merged
carljm merged 16 commits intoastral-sh:mainfrom
Hugo-Polloli:constructor-bindings-refactor
Feb 10, 2026
Merged

[ty] route constructor calls through bindings#22124
carljm merged 16 commits intoastral-sh:mainfrom
Hugo-Polloli:constructor-bindings-refactor

Conversation

@Hugo-Polloli
Copy link
Contributor

@Hugo-Polloli Hugo-Polloli commented Dec 21, 2025

Summary

fixes astral-sh/ty#2124

  • route constructor calls through the existing Type::bindings machinery via constructor_bindings(), ensuring constructor return types are instance-typed (not __init__'s None)
  • delete the legacy constructor call path
  • constructor overload resolution is deterministic (first matching overload), and implicit __new__/__init__ lints remain method-specific and fire once per call site (including the missing-__init__ fallback)

Test Plan

  • mdtest (constructor): added coverage for @staticmethod __new__, conflicting __new__/__init__ parameter types, __new__-only fallback (object __init__ accepts args), and generic constructor inference.
  • mdtest (decorators): functools.cached_property specifically added to address Support cached_property ty#1446
  • mdtest (classes): fixed the TODOs for generic class params C[Unknown] are now correctly revealed as C[int] (and constructor specialization uses first matching overload)
  • mdtest (functions): improved constructor path now correctly surfaces both the ill-typed generic call and the resulting invalid assignment

@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 21, 2025

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 82.43% to 82.45%. The percentage of expected errors that received a diagnostic increased from 73.29% to 73.38%.

Summary

Metric Old New Diff Outcome
True Positives 793 794 +1 ⏫ (✅)
False Positives 169 169 +0
False Negatives 289 288 -1 ⏬ (✅)
Total Diagnostics 962 963 +1
Precision 82.43% 82.45% +0.02% ⏫ (✅)
Recall 73.29% 73.38% +0.09% ⏫ (✅)

True positives added

Details
Location Name Message
generics_scoping.py:29:10 invalid-argument-type Argument to bound method meth_2 is incorrect: Expected int, found Literal["a"]

@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 21, 2025

mypy_primer results

Changes were detected when running on open source projects
attrs (https://github.com/python-attrs/attrs)
+ tests/test_make.py:2876:20: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ tests/test_make.py:2876:26: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ tests/test_make.py:2881:20: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ tests/test_make.py:2881:26: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ tests/test_make.py:2886:20: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ tests/test_make.py:2886:26: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
- Found 633 diagnostics
+ Found 639 diagnostics

spack (https://github.com/spack/spack)
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/cmd/create.py:1084:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str]`, found `Unknown | str | list[str]`
+ lib/spack/spack/database.py:652:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `lib.spack.spack.llnl.util.lock.Lock`, found `ForbiddenLock | lib.spack.spack.util.lock.Lock`
+ lib/spack/spack/database.py:656:44: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `lib.spack.spack.llnl.util.lock.Lock`, found `ForbiddenLock | lib.spack.spack.util.lock.Lock`
- Found 4365 diagnostics
+ Found 4392 diagnostics

bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch/tests/test_configuration.py:109:29: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | None`
- Found 67 diagnostics
+ Found 68 diagnostics

werkzeug (https://github.com/pallets/werkzeug)
+ tests/test_datastructures.py:412:41: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `(str | None, /) -> Literal[-1]`, found `<class 'int'>`
+ tests/test_datastructures.py:413:41: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `(str | None, /) -> Literal[-1]`, found `<class 'int'>`
- Found 395 diagnostics
+ Found 397 diagnostics

black (https://github.com/psf/black)
- src/black/trans.py:470:20: error[invalid-return-type] Return type does not match returned value: expected `Ok[list[int]] | Err[CannotTransform]`, found `Ok[list[Unknown] & ~AlwaysFalsy]`
- src/black/trans.py:984:20: error[invalid-return-type] Return type does not match returned value: expected `Ok[list[int]] | Err[CannotTransform]`, found `Ok[list[Unknown] & ~AlwaysFalsy]`
- Found 50 diagnostics
+ Found 48 diagnostics

paasta (https://github.com/yelp/paasta)
+ paasta_tools/cli/cmds/logs.py:1229:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `str | None`
- Found 1074 diagnostics
+ Found 1075 diagnostics

scrapy (https://github.com/scrapy/scrapy)
+ tests/test_http_request.py:33:13: error[missing-argument] No argument provided for required parameter `url` of bound method `__init__`
+ tests/test_http_request.py:37:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Literal[123]`
+ tests/test_http_request.py:207:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `((Unknown, /) -> Any) | None`, found `def somecallback() -> Unknown`
+ tests/test_http_request.py:324:54: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `((Unknown, /) -> Any) | None`, found `Literal["a_function"]`
+ tests/test_http_request.py:329:17: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `((Unknown, /) -> Any) | None`, found `Literal["a_function"]`
+ tests/test_http_request.py:513:75: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Iterable[str]] | list[tuple[str, Iterable[str]]] | None`, found `tuple[tuple[Literal["a"], Literal["one"]], tuple[Literal["a"], Literal["two"]], tuple[Literal["b"], Literal["2"]]]`
+ tests/test_http_request.py:515:56: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Iterable[str]] | list[tuple[str, Iterable[str]]] | None`, found `tuple[tuple[Literal["a"], Literal["one"]], tuple[Literal["a"], Literal["two"]], tuple[Literal["b"], Literal["2"]]]`
+ tests/test_http_request.py:530:59: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Iterable[str]] | list[tuple[str, Iterable[str]]] | None`, found `dict[Unknown | bytes, Unknown | bytes]`
+ tests/test_http_request.py:548:59: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Iterable[str]] | list[tuple[str, Iterable[str]]] | None`, found `dict[Unknown | str | bytes, Unknown | bytes | str]`
+ tests/test_http_request.py:557:39: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Iterable[str]] | list[tuple[str, Iterable[str]]] | None`, found `dict[Unknown | bytes, Unknown | bytes]`
+ tests/test_http_response.py:30:13: error[missing-argument] No argument provided for required parameter `url` of bound method `__init__`
+ tests/test_http_response.py:35:33: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Literal[b"http://example.com"]`
+ tests/test_http_response.py:37:59: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bytes`, found `dict[Unknown, Unknown]`
+ tests/test_http_response.py:72:59: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal["301"]`
+ tests/test_http_response.py:75:55: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal["lala200"]`
- Found 1781 diagnostics
+ Found 1796 diagnostics

ignite (https://github.com/pytorch/ignite)
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[tuple[int, int | float]]`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[int]`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(int, /) -> list[int | float] | int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:351:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[tuple[int, int | float]]`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[int]`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(int, /) -> list[int | float] | int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | list[Unknown | tuple[int, int]] | ... omitted 4 union elements`
- Found 2096 diagnostics
+ Found 2136 diagnostics

pybind11 (https://github.com/pybind/pybind11)
+ tests/test_pytypes.py:457:29: error[no-matching-overload] No overload of bound method `__init__` matches arguments
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | Buffer`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[SupportsIndex] | SupportsIndex | Buffer`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
+ tests/test_pytypes.py:457:31: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Buffer`, found `Unknown | bytes | bytearray | ... omitted 5 union elements`
- Found 216 diagnostics
+ Found 225 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
- github/PaginatedList.py:372:101: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/Requester.py:916:38: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/Requester.py:924:38: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 325 diagnostics
+ Found 322 diagnostics

flake8 (https://github.com/pycqa/flake8)
+ src/flake8/__init__.py:64:15: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 37 diagnostics
+ Found 38 diagnostics

pandera (https://github.com/pandera-dev/pandera)
- tests/pandas/test_decorators.py:931:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:933:48: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:935:52: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:944:42: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:946:46: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:948:50: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:959:43: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:961:47: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pandas/test_decorators.py:963:51: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 1644 diagnostics
+ Found 1635 diagnostics

vision (https://github.com/pytorch/vision)
+ test/test_transforms_v2.py:2572:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[(...) -> Unknown]`, found `(x) -> Unknown`
+ test/test_transforms_v2.py:2572:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[(...) -> Unknown]`, found `(x) -> Unknown`
+ test/test_transforms_v2.py:2572:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[(...) -> Unknown]`, found `(x) -> Unknown`
- Found 1391 diagnostics
+ Found 1394 diagnostics

artigraph (https://github.com/artigraph/artigraph)
+ src/arti/types/bigquery.py:231:13: error[invalid-argument-type] Argument is incorrect: Expected `Struct`, found `Type`
+ src/arti/types/pyarrow.py:241:13: error[invalid-argument-type] Argument is incorrect: Expected `Struct`, found `Type`
+ src/arti/types/python.py:158:83: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `tuple[Any, ...]`
- Found 146 diagnostics
+ Found 149 diagnostics

optuna (https://github.com/optuna/optuna)
- optuna/storages/_rdb/storage.py:351:16: error[invalid-return-type] Return type does not match returned value: expected `str`, found `Unknown | Column[Unknown]`
+ optuna/storages/_rdb/storage.py:351:16: error[invalid-return-type] Return type does not match returned value: expected `str`, found `Unknown | Column[str]`
- optuna/storages/_rdb/storage.py:365:48: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[Unknown]`
+ optuna/storages/_rdb/storage.py:365:48: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[str]`
- optuna/storages/_rdb/storage.py:367:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[Unknown], Unknown]`
+ optuna/storages/_rdb/storage.py:367:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[str], Unknown]`
- optuna/storages/_rdb/storage.py:374:50: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[Unknown]`
+ optuna/storages/_rdb/storage.py:374:50: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[str]`
- optuna/storages/_rdb/storage.py:376:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[Unknown], Unknown]`
+ optuna/storages/_rdb/storage.py:376:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[str], Unknown]`
- optuna/storages/_rdb/storage.py:384:48: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[Unknown]`
+ optuna/storages/_rdb/storage.py:384:48: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[str]`
- optuna/storages/_rdb/storage.py:386:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[Unknown], Unknown]`
+ optuna/storages/_rdb/storage.py:386:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[str], Unknown]`
- optuna/storages/_rdb/storage.py:394:50: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[Unknown]`
+ optuna/storages/_rdb/storage.py:394:50: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `Unknown | Column[str]`
- optuna/storages/_rdb/storage.py:396:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[Unknown], Unknown]`
+ optuna/storages/_rdb/storage.py:396:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `dict[Unknown | Column[str], Unknown]`
- optuna/storages/_rdb/storage.py:628:21: error[invalid-argument-type] Argument to function `json_to_distribution` is incorrect: Expected `str`, found `Unknown | Column[Unknown]`
+ optuna/storages/_rdb/storage.py:628:21: error[invalid-argument-type] Argument to function `json_to_distribution` is incorrect: Expected `str`, found `Unknown | Column[str]`

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- pymongo/read_preferences.py:535:66: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 442 diagnostics
+ Found 441 diagnostics

comtypes (https://github.com/enthought/comtypes)
+ comtypes/test/test_util.py:28:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Unknown | int | float | bytes`
+ comtypes/test/test_util.py:28:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Unknown | int | float | bytes`
+ comtypes/test/test_util.py:28:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | bytes | bytearray`, found `Unknown | int | float | bytes`
- Found 490 diagnostics
+ Found 493 diagnostics

apprise (https://github.com/caronc/apprise)
+ apprise/plugins/email/base.py:562:22: error[no-matching-overload] No overload of bound method `__init__` matches arguments
+ apprise/plugins/email/base.py:563:17: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | int | tuple[Unknown | str] | None`
+ apprise/plugins/email/base.py:564:17: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Unknown | int | str | tuple[Unknown | str] | None`
+ apprise/plugins/fcm/__init__.py:266:13: error[unknown-argument] Argument `user_agent` does not match any known parameter of bound method `__init__`
+ apprise/plugins/fcm/__init__.py:267:13: error[unknown-argument] Argument `timeout` does not match any known parameter of bound method `__init__`
+ apprise/plugins/fcm/__init__.py:268:13: error[unknown-argument] Argument `verify_certificate` does not match any known parameter of bound method `__init__`
- Found 3155 diagnostics
+ Found 3161 diagnostics

openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/plugins/worksearch/code.py:454:17: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, list[tuple[str, str, int]]]`, found `dict[Unknown, Unknown] | None`
+ openlibrary/plugins/worksearch/code.py:454:17: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, list[tuple[str, str, int]]]`, found `dict[str, list[tuple[str, str, int]]] | None`

cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/cmd/devel/net_convert.py:194:15: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown] | None`, found `MutableMapping[str, Any] | None`
- Found 1145 diagnostics
+ Found 1146 diagnostics

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/backend/ninjabackend.py:655:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[str] | None`, found `Unknown | _odict_values[str, CustomTarget | BuildTarget]`
+ mesonbuild/compilers/detect.py:1157:73: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | list[str]`, found `None | str | list[str]`
+ mesonbuild/interpreter/interpreter.py:3589:79: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[File | CustomTarget | CustomTargetIndex | ... omitted 4 union elements]`, found `list[File | str | CustomTarget | ... omitted 5 union elements]`
+ mesonbuild/interpreter/interpreter.py:3589:79: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[File | CustomTarget | CustomTargetIndex | ... omitted 4 union elements]`, found `list[File | str | CustomTarget | ... omitted 5 union elements]`
+ mesonbuild/interpreter/interpreter.py:3589:79: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[File | CustomTarget | CustomTargetIndex | ... omitted 4 union elements]`, found `list[File | str | CustomTarget | ... omitted 5 union elements]`
+ mesonbuild/interpreter/interpreter.py:3589:79: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[File | CustomTarget | CustomTargetIndex | ... omitted 4 union elements]`, found `list[File | str | CustomTarget | ... omitted 5 union elements]`
+ mesonbuild/interpreter/interpreter.py:3590:77: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ExecutableKeywordArguments`, found `Executable | StaticLibrary | SharedLibrary | SharedModule | Jar`
+ mesonbuild/interpreter/interpreter.py:3590:77: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `StaticLibraryKeywordArguments`, found `Executable | StaticLibrary | SharedLibrary | SharedModule | Jar`
- Found 2200 diagnostics
+ Found 2208 diagnostics

xarray (https://github.com/pydata/xarray)
+ xarray/coding/times.py:451:53: error[no-matching-overload] No overload of function `__new__` matches arguments
+ xarray/core/resample_cftime.py:409:23: error[no-matching-overload] No overload of function `__new__` matches arguments
- xarray/tests/test_variable.py:2740:30: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 1718 diagnostics
+ Found 1719 diagnostics

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/aglib/heap/ptmalloc.py:2151:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `int | None`
- Found 1889 diagnostics
+ Found 1890 diagnostics

setuptools (https://github.com/pypa/setuptools)
- setuptools/_distutils/compilers/C/base.py:481:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[list[str], str]`, found `tuple[list[Unknown], str | None]`
+ setuptools/_distutils/compilers/C/base.py:481:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[list[str], str]`, found `tuple[list[str], str | None]`

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/utilities/collections.py:488:40: error[invalid-argument-type] Argument is incorrect: Expected `tuple[Any]`, found `list[Unknown | None]`
- Found 5504 diagnostics
+ Found 5505 diagnostics

aiohttp (https://github.com/aio-libs/aiohttp)
- aiohttp/web_protocol.py:65:10: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- aiohttp/web_protocol.py:66:10: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 196 diagnostics
+ Found 194 diagnostics

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/ensemble/_forest.py:348:21: error[missing-argument] No argument provided for required parameter `self` of function `__init__`
+ sklearn/ensemble/_forest.py:348:42: error[unknown-argument] Argument `criterion` does not match any known parameter of function `__init__`
+ sklearn/ensemble/_forest.py:700:21: error[missing-argument] No argument provided for required parameter `self` of function `__init__`
+ sklearn/ensemble/_forest.py:700:42: error[unknown-argument] Argument `criterion` does not match any known parameter of function `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_gb.py:2146:68: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:1869:46: error[unknown-argument] Argument `quantile` does not match any known parameter of bound method `__init__`
- Found 2468 diagnostics
+ Found 2488 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ benchmarks/encoder/utils.py:27:16: error[missing-argument] No arguments provided for required parameters `max_size`, `max_item_size` of bound method `__init__`
+ benchmarks/encoder/utils.py:27:16: error[missing-argument] No arguments provided for required parameters `max_size`, `max_item_size` of bound method `__init__`
+ ddtrace/appsec/_common_module_patches.py:158:45: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `FrameType`, found `FrameType | None`
+ ddtrace/appsec/_common_module_patches.py:158:45: error[too-many-positional-arguments] Too many positional arguments to function `__init__`: expected 1, got 4
+ ddtrace/appsec/_common_module_patches.py:196:45: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `FrameType`, found `FrameType | None`
+ ddtrace/appsec/_common_module_patches.py:196:45: error[too-many-positional-arguments] Too many positional arguments to function `__init__`: expected 1, got 4
+ ddtrace/debugging/_debugger.py:271:63: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | DerivedVariable[str | Unknown]`
+ ddtrace/debugging/_debugger.py:271:63: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | DerivedVariable[str | Unknown]`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:321:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:339:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:358:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:377:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:396:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[str] | None`, found `Unknown | bool`
+ ddtrace/vendor/psutil/setup.py:412:9: error[invalid-argument-type]

... (truncated 622 lines) ...

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 21, 2025

CodSpeed Performance Report

Merging this PR will degrade performance by 9.94%

Comparing Hugo-Polloli:constructor-bindings-refactor (3885e2f) with main (20a1741)

Summary

❌ 1 (👁 1) regressed benchmark
✅ 23 untouched benchmarks
⏩ 30 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
👁 WallTime static_frame 23.8 s 26.4 s -9.94%

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Hugo-Polloli Hugo-Polloli marked this pull request as draft December 21, 2025 03:55
@AlexWaygood AlexWaygood removed their request for review December 21, 2025 08:54
@Hugo-Polloli Hugo-Polloli force-pushed the constructor-bindings-refactor branch 2 times, most recently from 4767d0c to f4c53d0 Compare December 21, 2025 15:04
@AlexWaygood AlexWaygood changed the title ty: route constructor calls through bindings [ty] route constructor calls through bindings Dec 21, 2025
@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Dec 21, 2025
@Hugo-Polloli Hugo-Polloli force-pushed the constructor-bindings-refactor branch 3 times, most recently from 22c5691 to ebb4b8b Compare December 22, 2025 14:42
@Hugo-Polloli Hugo-Polloli marked this pull request as ready for review December 22, 2025 14:59
@Hugo-Polloli
Copy link
Contributor Author

Hugo-Polloli commented Dec 22, 2025

Hi all ! This should be ready for review, though I have a question concerning the test assertions I modified inside functions.md, the previous TODO mentioned no error but to my knowledge the comment I added is correct and the two errors surfaced should indeed appear, so I'd like your input on which it should be ! Thanks :)

@carljm
Copy link
Contributor

carljm commented Dec 23, 2025

Wow, awesome, thank you for working on this!

It looks like the diagnostics that this PR removes on lines 81 and 82 of the conformance suite, in constructors_call_type.py, are supposed to be there, so that looks like a regression in this PR (and maybe some coverage we are missing in mdtests.)

The diagnostic added on line 29 of generics_scoping.py is correct, looks like a fix from this PR!

@Hugo-Polloli Hugo-Polloli force-pushed the constructor-bindings-refactor branch 3 times, most recently from dd376de to c5f5d23 Compare December 23, 2025 12:03
class Builder(Generic[TMsg]):
def build(self) -> Stream[TMsg]:
stream: Stream[TMsg] = Stream()
# TODO: no error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the previous TODO mentioned no error but to my knowledge the comment I added is correct and the two errors surfaced should indeed appear, so I'd like your input on which it should be, thanks !

@Hugo-Polloli Hugo-Polloli force-pushed the constructor-bindings-refactor branch from c5f5d23 to ca77a7d Compare December 23, 2025 12:18
@Hugo-Polloli
Copy link
Contributor Author

Wow, awesome, thank you for working on this!

It looks like the diagnostics that this PR removes on lines 81 and 82 of the conformance suite, in constructors_call_type.py, are supposed to be there, so that looks like a regression in this PR (and maybe some coverage we are missing in mdtests.)

The diagnostic added on line 29 of generics_scoping.py is correct, looks like a fix from this PR!

Indeed looks like a regression ! That was because I missed updating the TypeVar matching arms, so thanks for catching that, I fixed it to validate params against the bound class and added an mdtest (straight copied from typing conformance) to prevent future regression on that side

CI is currently red for reasons that look unrelated to this change: mypy_primer is failing while cloning pypa/twine (git clone … exit 128), and codspeed is panicking. I’ll rerun CI and dig in after Christmas if issues persist :)

@sinon
Copy link
Contributor

sinon commented Dec 23, 2025

CI is currently red for reasons that look unrelated to this change: mypy_primer is failing while cloning pypa/twine (git clone … exit 128), and codspeed is panicking. I’ll rerun CI and dig in after Christmas if issues persist :)

The CodSpeed panic is related to your change but not necessarily a blocker to the change. There is an assertion in each benchmarked library that the number of diagnostics are >0 but less than a per-library upperbound but your change means it is now above this bound. If the new diagnostics are not false-positives then you just increase the number in the relevant file (plus some headroom). The relevant setting is here:

@Hugo-Polloli
Copy link
Contributor Author

CI is currently red for reasons that look unrelated to this change: mypy_primer is failing while cloning pypa/twine (git clone … exit 128), and codspeed is panicking. I’ll rerun CI and dig in after Christmas if issues persist :)

The CodSpeed panic is related to your change but not necessarily a blocker to the change. There is an assertion in each benchmarked library that the number of diagnostics are >0 but less than a per-library upperbound but your change means it is now above this bound. If the new diagnostics are not false-positives then you just increase the number in the relevant file (plus some headroom). The relevant setting is here:

Thanks for the explanation ! I found the way to run it locally, I'll check the diffs and whether they're regressions/bugs when I get back :)

@Hugo-Polloli Hugo-Polloli force-pushed the constructor-bindings-refactor branch from ca77a7d to 21d12be Compare December 26, 2025 19:50
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 26, 2025

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 389 0 6
unknown-argument 32 0 0
unused-type-ignore-comment 0 22 0
missing-argument 16 0 0
too-many-positional-arguments 16 0 0
invalid-return-type 0 3 6
type-assertion-failure 0 3 3
no-matching-overload 4 0 0
parameter-already-assigned 4 0 0
Total 461 28 15

Full report with detailed diff (timing results)

@Hugo-Polloli
Copy link
Contributor Author

This is awesome! Sorry you had to wait so long for review; we've been behind on reviews ever since the beta and holidays.

Left some inline comments, but I think the most important one is that I think we should adjust the signature of constructor_bindings and how it is called from Type::bindings to make it less error-prone: make it not a method on Type and not accept a Type, but rather accept just a ClassLiteral, and never return None.

Thanks a ton for the thorough review! No worries at all about the time to review!
I've addressed all your feedback throughout my last 3 commits,
[ty] address review for mdtests and comments for all the mdtests/comments suggestions
[ty] create a known_class_literal_bindings helper is a transitory commit to move KnownClass constructor special‑cases into a helper so the later refactor stays reviewable and "diff‑light"
[ty] refactor constructor_bindings to take ClassType is the main refactor: class‑like call handling is centralized, constructor_bindings now takes a ClassType and returns Bindings, the ClassLiteral/GenericAlias/SubclassOf paths are collapsed, and type[T] constraints keep their gradual behavior

I also preserved existing behavior around type[T] constraints and TypedDict/known‑class special cases, and added a couple clarifying comments where behavior could look surprising

@AlexWaygood AlexWaygood requested a review from carljm February 6, 2026 00:51
@Hugo-Polloli Hugo-Polloli force-pushed the constructor-bindings-refactor branch from e32c211 to 891c3f5 Compare February 6, 2026 18:06
@Hugo-Polloli
Copy link
Contributor Author

Hit a merge conflict with #23113 after it merged
Which I resolved so now this PR includes that broadened TypedDict constructor validation (ClassLiteral + GenericAlias + SubclassOf) alongside the constructor-bindings refactor

inline `class_like_call_bindings`, make `constructor_bindings` a method
again
@carljm
Copy link
Contributor

carljm commented Feb 9, 2026

FYI I'm making some updates to this in preparation to merge it.

* main: (45 commits)
  [ty] Fix wrong inlay hints for overloaded function arguments (astral-sh#23179)
  [ty] Respect `@no_type_check` when combined with other decorators (astral-sh#23177)
  [ty] Use type context when inferring constructor argument types (astral-sh#23139)
  [`airflow`] Add ruff rules to catch deprecated attribute access from context key for Airflow 3.0 (`AIR301`) (astral-sh#22850)
  Support formatting `pycon` markdown code blocks (astral-sh#23112)
  Markdown formatting in LSP (astral-sh#23063)
  Instruct Claude to use comments more sparingly (astral-sh#23181)
  [`flake8-gettext`] Fix false negatives for plural argument of ngettext (`INT001`, `INT002`, `INT003`) (astral-sh#21078)
  [ty] Invoking goto-def on parentheses of a class constructor call takes you too constructor method
  [ty] Make goto definition on class constructor always go to class definition
  [ty] Assign lower completions ranking to deprecated functions and classes (astral-sh#23089)
  [ty] Fix parameter references across files via keyword args (astral-sh#23012)
  [ty] Exclude enclosing class for base completions (astral-sh#23141)
  [`pyupgrade`] Fix syntax error on string with newline escape and comment (`UP037`) (astral-sh#22968)
  [ty] Improve documentation for `expect_single_definition` method (astral-sh#23175)
  [ty] Configure check mode for all projects
  Add `home-assistant` to ecosystem projects (astral-sh#23132)
  Add tabbed shell completion documentation (astral-sh#23169)
  Bump typing conformance-suite pin (astral-sh#23174)
  [ty] Fix invalid diagnostic location for a sub-call to a specialized ParamSpec (astral-sh#23036)
  ...
* main:
  [ty] Detect flaky projects during ecosystem CI jobs (astral-sh#23178)
  [ty] Disallow TypeVars within ClassVars (astral-sh#23184)
* main:
  [ty] Fix Pyright links; use `heterogeneous_tuple` (astral-sh#23193)
  [ty] Limit fixed-length tuple expansion in overload matching (astral-sh#23190)
  Fixed import in `runtime-evaluated-decorators` example (astral-sh#23187)
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 10, 2026

Memory usage report

Summary

Project Old New Diff Outcome
flake8 51.80MB 51.79MB -0.0% (-0.01MB) ⬇️
trio 123.73MB 123.55MB -0.1% (-0.18MB) ⬇️
sphinx 282.10MB 281.67MB -0.2% (-0.43MB) ⬇️
prefect 709.25MB 707.58MB -0.2% (-1.66MB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
Type < 'db >::member_lookup_with_policy_::interned_arguments 0.21MB 0.21MB -1.5% (-0.00MB) ⬇️
Type < 'db >::class_member_with_policy_::interned_arguments 0.31MB 0.31MB -1.0% (-0.00MB) ⬇️
Type < 'db >::apply_specialization_::interned_arguments 0.21MB 0.21MB +1.2% (0.00MB) ⬇️
is_redundant_with_impl::interned_arguments 0.16MB 0.16MB -0.7% (-0.00MB) ⬇️
StaticClassLiteral < 'db >::implicit_attribute_inner_::interned_arguments 0.24MB 0.24MB +0.4% (0.00MB) ⬇️
FunctionType 0.45MB 0.45MB +0.2% (0.00MB) ⬇️
IntersectionType 0.08MB 0.08MB -0.9% (-0.00MB) ⬇️
place_by_id::interned_arguments 0.11MB 0.11MB +0.4% (0.00MB) ⬇️
OverloadLiteral 0.12MB 0.12MB +0.3% (0.00MB) ⬇️
Type < 'db >::try_call_dunder_get_::interned_arguments 0.09MB 0.09MB -0.4% (-0.00MB) ⬇️
CallableType 0.21MB 0.21MB -0.1% (-0.00MB) ⬇️
TupleType 0.08MB 0.08MB +0.3% (0.00MB) ⬇️
UnionType 0.11MB 0.11MB -0.2% (-0.00MB) ⬇️
Specialization 0.17MB 0.17MB +0.1% (0.00MB) ⬇️
FunctionLiteral 0.06MB 0.06MB +0.3% (0.00MB) ⬇️
... 28 more

prefect

Name Old New Diff Outcome
is_redundant_with_impl::interned_arguments 6.47MB 6.27MB -3.0% (-0.19MB) ⬇️
IntersectionType 2.73MB 2.59MB -5.0% (-0.14MB) ⬇️
Type < 'db >::member_lookup_with_policy_::interned_arguments 5.56MB 5.49MB -1.3% (-0.07MB) ⬇️
Type < 'db >::class_member_with_policy_::interned_arguments 9.33MB 9.26MB -0.7% (-0.07MB) ⬇️
UnionType 4.02MB 3.95MB -1.6% (-0.07MB) ⬇️
Type < 'db >::try_call_dunder_get_::interned_arguments 3.09MB 3.03MB -2.0% (-0.06MB) ⬇️
BoundMethodType 1.40MB 1.37MB -1.9% (-0.03MB) ⬇️
Type < 'db >::apply_specialization_::interned_arguments 2.95MB 2.95MB +0.2% (0.01MB) ⬇️
Specialization 2.55MB 2.55MB -0.2% (-0.00MB) ⬇️
TupleType 0.69MB 0.68MB -0.6% (-0.00MB) ⬇️
GenericAlias 1.20MB 1.20MB -0.3% (-0.00MB) ⬇️
StaticClassLiteral < 'db >::implicit_attribute_inner_::interned_arguments 5.17MB 5.17MB +0.0% (0.00MB) ⬇️
CallableType 2.41MB 2.40MB -0.1% (-0.00MB) ⬇️
lookup_dunder_new_inner::interned_arguments 0.06MB 0.06MB +1.8% (0.00MB) ⬇️
GenericContext 0.32MB 0.32MB -0.1% (-0.00MB) ⬇️
... 30 more

sphinx

Name Old New Diff Outcome
is_redundant_with_impl::interned_arguments 2.77MB 2.74MB -1.1% (-0.03MB) ⬇️
Type < 'db >::class_member_with_policy_::interned_arguments 4.23MB 4.20MB -0.7% (-0.03MB) ⬇️
Type < 'db >::member_lookup_with_policy_::interned_arguments 2.66MB 2.63MB -1.1% (-0.03MB) ⬇️
IntersectionType 1.08MB 1.06MB -2.2% (-0.02MB) ⬇️
Type < 'db >::try_call_dunder_get_::interned_arguments 1.30MB 1.29MB -0.8% (-0.01MB) ⬇️
UnionType 1.65MB 1.64MB -0.6% (-0.01MB) ⬇️
Type < 'db >::apply_specialization_::interned_arguments 1.54MB 1.54MB +0.3% (0.00MB) ⬇️
BoundMethodType 0.74MB 0.73MB -0.6% (-0.00MB) ⬇️
Specialization 1.09MB 1.08MB -0.3% (-0.00MB) ⬇️
GenericAlias 0.47MB 0.47MB -0.5% (-0.00MB) ⬇️
StaticClassLiteral < 'db >::try_mro_::interned_arguments 0.50MB 0.50MB -0.2% (-0.00MB) ⬇️
TupleType 0.59MB 0.59MB -0.1% (-0.00MB) ⬇️
FunctionType 3.32MB 3.32MB -0.0% (-0.00MB) ⬇️
code_generator_of_static_class::interned_arguments 0.26MB 0.26MB -0.1% (-0.00MB) ⬇️
lookup_dunder_new_inner::interned_arguments 0.03MB 0.03MB +0.8% (0.00MB) ⬇️
... 27 more

trio

Name Old New Diff Outcome
is_redundant_with_impl::interned_arguments 0.59MB 0.57MB -3.2% (-0.02MB) ⬇️
IntersectionType 0.26MB 0.25MB -5.2% (-0.01MB) ⬇️
Type < 'db >::member_lookup_with_policy_::interned_arguments 0.88MB 0.87MB -1.4% (-0.01MB) ⬇️
Type < 'db >::class_member_with_policy_::interned_arguments 1.17MB 1.16MB -1.0% (-0.01MB) ⬇️
UnionType 0.35MB 0.34MB -1.8% (-0.01MB) ⬇️
Type < 'db >::apply_specialization_::interned_arguments 0.68MB 0.68MB +0.9% (0.01MB) ⬇️
Type < 'db >::try_call_dunder_get_::interned_arguments 0.37MB 0.37MB -1.5% (-0.01MB) ⬇️
BoundMethodType 0.19MB 0.19MB -1.1% (-0.00MB) ⬇️
FunctionType 1.62MB 1.62MB +0.1% (0.00MB) ⬇️
CallableType 0.72MB 0.72MB +0.1% (0.00MB) ⬇️
StaticClassLiteral < 'db >::try_mro_::interned_arguments 0.21MB 0.21MB -0.1% (-0.00MB) ⬇️
GenericAlias 0.21MB 0.21MB -0.1% (-0.00MB) ⬇️
Specialization 0.49MB 0.49MB +0.0% (0.00MB) ⬇️
ProtocolInterface 0.11MB 0.11MB +0.1% (0.00MB) ⬇️
StaticClassLiteral < 'db >::implicit_attribute_inner_::interned_arguments 0.63MB 0.63MB +0.0% (0.00MB) ⬇️
... 23 more

@carljm carljm merged commit a0939fd into astral-sh:main Feb 10, 2026
50 checks passed
@Hugo-Polloli Hugo-Polloli deleted the constructor-bindings-refactor branch March 1, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

re-unify Type::try_call_constructor and Type::bindings

5 participants