Skip to content

[ty] View ecosystem results for synthetic protocol#25112

Draft
charliermarsh wants to merge 6 commits into
charlie/protocol-property-checkfrom
charlie/is-dataclass
Draft

[ty] View ecosystem results for synthetic protocol#25112
charliermarsh wants to merge 6 commits into
charlie/protocol-property-checkfrom
charlie/is-dataclass

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

No description provided.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label May 12, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented May 12, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 89.54%. The percentage of expected errors that received a diagnostic held steady at 86.33%. The number of fully passing files held steady at 88/134.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented May 12, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 681.43MB 682.02MB +0.09% (607.31kB)
trio 115.56MB 115.67MB +0.10% (114.56kB)
sphinx 256.23MB 256.33MB +0.04% (103.62kB)
flake8 47.42MB 47.44MB +0.04% (21.32kB)

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
infer_definition_types 80.91MB 81.09MB +0.23% (191.93kB)
CallableType 2.45MB 2.53MB +3.26% (81.92kB)
infer_scope_types_impl 47.48MB 47.53MB +0.10% (49.14kB)
infer_expression_types_impl 52.20MB 52.25MB +0.09% (48.08kB)
ProtocolInterface 274.83kB 321.93kB +17.14% (47.10kB)
all_narrowing_constraints_for_expression 6.44MB 6.46MB +0.45% (29.88kB)
all_negative_narrowing_constraints_for_expression 6.23MB 6.26MB +0.47% (29.77kB)
SynthesizedProtocolType 0.00B 14.98kB +14.98kB (new)
Type<'db>::apply_specialization_ 3.14MB 3.15MB +0.32% (10.38kB)
FunctionType 9.45MB 9.46MB +0.10% (9.80kB)
when_constraint_set_assignable_to_owned_impl 1.61MB 1.62MB +0.58% (9.57kB)
cached_protocol_interface 405.30kB 414.76kB +2.33% (9.46kB)
Specialization 2.21MB 2.22MB +0.37% (8.44kB)
StaticClassLiteral<'db>::try_mro_ 4.43MB 4.43MB +0.17% (7.83kB)
infer_expression_type_impl 7.78MB 7.78MB +0.09% (7.05kB)
... 34 more

trio

Name Old New Diff Outcome
CallableType 611.93kB 648.22kB +5.93% (36.30kB)
infer_definition_types 7.24MB 7.26MB +0.26% (19.01kB)
ProtocolInterface 81.88kB 100.25kB +22.44% (18.37kB)
Type<'db>::apply_specialization_ 615.64kB 619.95kB +0.70% (4.30kB)
SynthesizedProtocolType 0.00B 3.38kB +3.38kB (new)
cached_protocol_interface 124.68kB 127.95kB +2.62% (3.27kB)
Specialization 457.22kB 460.48kB +0.71% (3.27kB)
function_known_decorators 294.15kB 297.07kB +0.99% (2.92kB)
infer_deferred_types 2.10MB 2.10MB +0.14% (2.92kB)
infer_expression_types_impl 6.26MB 6.26MB +0.04% (2.82kB)
FunctionType 1.52MB 1.53MB +0.16% (2.52kB)
StaticClassLiteral<'db>::try_mro_ 793.98kB 796.29kB +0.29% (2.31kB)
GenericAlias 188.02kB 189.70kB +0.90% (1.69kB)
Type<'db>::apply_specialization_::interned_arguments 624.92kB 626.48kB +0.25% (1.56kB)
infer_scope_types_impl 4.02MB 4.02MB +0.03% (1.27kB)
... 22 more

sphinx

Name Old New Diff Outcome
infer_expression_types_impl 18.53MB 18.55MB +0.13% (23.80kB)
infer_definition_types 21.99MB 22.01MB +0.09% (19.30kB)
infer_scope_types_impl 12.97MB 12.98MB +0.13% (17.13kB)
CallableType 1.16MB 1.17MB +0.89% (10.53kB)
ProtocolInterface 128.23kB 133.25kB +3.91% (5.02kB)
SynthesizedProtocolType 0.00B 4.57kB +4.57kB (new)
when_constraint_set_assignable_to_owned_impl 949.16kB 951.85kB +0.28% (2.69kB)
FunctionType 3.18MB 3.18MB +0.07% (2.19kB)
StaticClassLiteral<'db>::try_mro_ 1.93MB 1.93MB +0.09% (1.77kB)
all_narrowing_constraints_for_expression 2.46MB 2.46MB +0.05% (1.35kB)
all_negative_narrowing_constraints_for_expression 2.38MB 2.38MB +0.05% (1.29kB)
Type<'db>::apply_specialization_ 1.41MB 1.41MB +0.09% (1.25kB)
FunctionType<'db>::signature_ 2.38MB 2.38MB +0.05% (1.17kB)
class_mro_literals 316.00B 1.34kB +335.44% (1.04kB)
infer_statement_types_impl 17.93kB 18.87kB +5.23% (960.00B)
... 31 more

flake8

Name Old New Diff Outcome
CallableType 177.02kB 184.61kB +4.29% (7.59kB)
infer_definition_types 1.72MB 1.72MB +0.18% (3.12kB)
ProtocolInterface 27.95kB 30.81kB +10.24% (2.86kB)
infer_scope_types_impl 823.21kB 825.48kB +0.27% (2.26kB)
StaticClassLiteral<'db>::try_mro_ 312.45kB 313.70kB +0.40% (1.24kB)
FunctionType 451.45kB 452.67kB +0.27% (1.22kB)
infer_expression_types_impl 936.91kB 937.61kB +0.08% (720.00B)
FunctionType<'db>::signature_ 378.94kB 379.58kB +0.17% (656.00B)
BoundTypeVarInstance 44.93kB 45.49kB +1.25% (576.00B)
cached_protocol_interface 44.55kB 45.09kB +1.21% (552.00B)
SynthesizedProtocolType 0.00B 504.00B +504.00B (new)
Type<'db>::class_member_with_policy_ 574.89kB 574.45kB -0.08% (456.00B)
StaticClassLiteral<'db>::try_mro_::interned_arguments 71.37kB 71.79kB +0.59% (432.00B)
Type<'db>::class_member_with_policy_::interned_arguments 312.20kB 311.90kB -0.10% (312.00B)
TypeVarInstance 19.22kB 19.50kB +1.46% (288.00B)
... 15 more

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented May 12, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 0 0 9
unresolved-attribute 0 0 5
invalid-type-guard-definition 0 0 3
invalid-yield 0 1 1
invalid-assignment 0 0 1
invalid-return-type 0 0 1
not-subscriptable 0 0 1
Total 0 1 21
Raw diff (22 changes)
core (https://github.com/home-assistant/core)
- homeassistant/components/tessie/entity.py:102:34 error[invalid-argument-type] Argument to function `handle_command` is incorrect: Expected `Awaitable[dict[str, Any]]`, found `(((...) -> Awaitable[dict[str, Any]]) & Awaitable[object]) | Awaitable[dict[str, Any]]`
+ homeassistant/components/tessie/entity.py:102:34 error[invalid-argument-type] Argument to function `handle_command` is incorrect: Expected `Awaitable[dict[str, Any]]`, found `(((...) -> Awaitable[dict[str, Any]]) & <Protocol with members '__await__'>) | Awaitable[dict[str, Any]]`

discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/cog.py:461:32 error[invalid-yield] Yield type `Command[Never, (...), Any]` does not match annotated yield type `Command[Self@walk_commands, (...), Any]`
+ discord/ext/commands/cog.py:461:32 error[invalid-yield] Yield type `Command[CogT@GroupMixin, (...), Any]` does not match annotated yield type `Command[Self@walk_commands, (...), Any]`
- discord/ext/commands/core.py:1455:28 error[invalid-yield] Yield type `Command[Never, (...), Any]` does not match annotated yield type `Command[CogT@GroupMixin, (...), Any]`

mypy (https://github.com/python/mypy)
- mypy/typeshed/stdlib/dataclasses.pyi:380:33 error[invalid-type-guard-definition] Narrowed type `DataclassInstance | type` is not assignable to the declared parameter type `Never`
+ mypy/typeshed/stdlib/dataclasses.pyi:380:33 error[invalid-type-guard-definition] Narrowed type `<Protocol with members '__dataclass_fields__'> | type` is not assignable to the declared parameter type `Never`
- mypy/typeshed/stdlib/dataclasses.pyi:382:32 error[invalid-type-guard-definition] Narrowed type `DataclassInstance | type` is not assignable to the declared parameter type `Never`
+ mypy/typeshed/stdlib/dataclasses.pyi:382:32 error[invalid-type-guard-definition] Narrowed type `<Protocol with members '__dataclass_fields__'> | type` is not assignable to the declared parameter type `Never`
- mypy/typeshed/stdlib/dataclasses.pyi:384:34 error[invalid-type-guard-definition] Narrowed type `DataclassInstance | type` is not assignable to the declared parameter type `Never`
+ mypy/typeshed/stdlib/dataclasses.pyi:384:34 error[invalid-type-guard-definition] Narrowed type `<Protocol with members '__dataclass_fields__'> | type` is not assignable to the declared parameter type `Never`

pandas (https://github.com/pandas-dev/pandas)
- pandas/io/formats/style.py:4352:41 error[invalid-argument-type] Argument to function `_validate_apply_axis_arg` is incorrect: Expected `NDFrame | Sequence[Unknown] | ndarray[tuple[Any, ...], dtype[Any]]`, found `bytes | (date & Iterable[object]) | (timedelta & Iterable[object]) | ... omitted 12 union elements`
+ pandas/io/formats/style.py:4352:41 error[invalid-argument-type] Argument to function `_validate_apply_axis_arg` is incorrect: Expected `NDFrame | Sequence[Unknown] | ndarray[tuple[Any, ...], dtype[Any]]`, found `bytes | (date & <Protocol with members '__iter__'>) | (timedelta & <Protocol with members '__iter__'>) | ... omitted 12 union elements`
- pandas/io/formats/style.py:4355:42 error[invalid-argument-type] Argument to function `_validate_apply_axis_arg` is incorrect: Expected `NDFrame | Sequence[Unknown] | ndarray[tuple[Any, ...], dtype[Any]]`, found `bytes | (date & Iterable[object]) | (timedelta & Iterable[object]) | ... omitted 12 union elements`
+ pandas/io/formats/style.py:4355:42 error[invalid-argument-type] Argument to function `_validate_apply_axis_arg` is incorrect: Expected `NDFrame | Sequence[Unknown] | ndarray[tuple[Any, ...], dtype[Any]]`, found `bytes | (date & <Protocol with members '__iter__'>) | (timedelta & <Protocol with members '__iter__'>) | ... omitted 12 union elements`
- pandas/io/formats/style.py:4377:22 error[invalid-argument-type] Argument to function `ge` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~Iterable[object]) | (timedelta & ~Iterable[object]) | (datetime64[date | int | None] & ~Iterable[object]) | ... omitted 10 union elements`
+ pandas/io/formats/style.py:4377:22 error[invalid-argument-type] Argument to function `ge` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~<Protocol with members '__iter__'>) | (timedelta & ~<Protocol with members '__iter__'>) | (datetime64[date | int | None] & ~<Protocol with members '__iter__'>) | ... omitted 10 union elements`
- pandas/io/formats/style.py:4377:22 error[invalid-argument-type] Argument to function `gt` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~Iterable[object]) | (timedelta & ~Iterable[object]) | (datetime64[date | int | None] & ~Iterable[object]) | ... omitted 10 union elements`
+ pandas/io/formats/style.py:4377:22 error[invalid-argument-type] Argument to function `gt` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~<Protocol with members '__iter__'>) | (timedelta & ~<Protocol with members '__iter__'>) | (datetime64[date | int | None] & ~<Protocol with members '__iter__'>) | ... omitted 10 union elements`
- pandas/io/formats/style.py:4388:22 error[invalid-argument-type] Argument to function `le` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~Iterable[object]) | (timedelta & ~Iterable[object]) | (datetime64[date | int | None] & ~Iterable[object]) | ... omitted 10 union elements`
+ pandas/io/formats/style.py:4388:22 error[invalid-argument-type] Argument to function `le` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~<Protocol with members '__iter__'>) | (timedelta & ~<Protocol with members '__iter__'>) | (datetime64[date | int | None] & ~<Protocol with members '__iter__'>) | ... omitted 10 union elements`
- pandas/io/formats/style.py:4388:22 error[invalid-argument-type] Argument to function `lt` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~Iterable[object]) | (timedelta & ~Iterable[object]) | (datetime64[date | int | None] & ~Iterable[object]) | ... omitted 10 union elements`
+ pandas/io/formats/style.py:4388:22 error[invalid-argument-type] Argument to function `lt` is incorrect: Expected `_SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT`, found `(date & ~<Protocol with members '__iter__'>) | (timedelta & ~<Protocol with members '__iter__'>) | (datetime64[date | int | None] & ~<Protocol with members '__iter__'>) | ... omitted 10 union elements`

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/_internal/concurrency/calls.py:409:24 error[invalid-return-type] Return type does not match returned value: expected `Awaitable[T@Call] | None`, found `(T@Call & Awaitable[object]) | Awaitable[T@Call]`
+ src/prefect/_internal/concurrency/calls.py:409:24 error[invalid-return-type] Return type does not match returned value: expected `Awaitable[T@Call] | None`, found `(T@Call & <Protocol with members '__await__'>) | Awaitable[T@Call]`

pyodide (https://github.com/pyodide/pyodide)
- src/py/pyodide/webloop.py:120:31 error[invalid-argument-type] Argument to bound method `Future.set_result` is incorrect: Expected `S@then`, found `~Awaitable[object]`
+ src/py/pyodide/webloop.py:120:31 error[invalid-argument-type] Argument to bound method `Future.set_result` is incorrect: Expected `S@then`, found `~<Protocol with members '__await__'>`

pytest (https://github.com/pytest-dev/pytest)
- src/_pytest/assertion/util.py:552:22 error[unresolved-attribute] Object of type `~DataclassInstance & ~type` has no attribute `__attrs_attrs__`
+ src/_pytest/assertion/util.py:552:22 error[unresolved-attribute] Object of type `~<Protocol with members '__dataclass_fields__'> & ~type` has no attribute `__attrs_attrs__`
- src/_pytest/assertion/util.py:555:27 error[unresolved-attribute] Object of type `~DataclassInstance & ~type` has no attribute `_fields`
+ src/_pytest/assertion/util.py:555:27 error[unresolved-attribute] Object of type `~<Protocol with members '__dataclass_fields__'> & ~type` has no attribute `_fields`

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/gaussian_process/_gpr.py:287:40 error[unresolved-attribute] Attribute `shape` is not defined on `int & Iterable[object]`, `float & Iterable[object]` in union `(Unknown & Iterable[object]) | (int & Iterable[object]) | (float & Iterable[object])`
+ sklearn/gaussian_process/_gpr.py:287:40 error[unresolved-attribute] Attribute `shape` is not defined on `int & <Protocol with members '__iter__'>`, `float & <Protocol with members '__iter__'>` in union `(Unknown & <Protocol with members '__iter__'>) | (int & <Protocol with members '__iter__'>) | (float & <Protocol with members '__iter__'>)`
- sklearn/gaussian_process/_gpr.py:288:16 error[unresolved-attribute] Attribute `shape` is not defined on `int & Iterable[object]`, `float & Iterable[object]` in union `(Unknown & Iterable[object]) | (int & Iterable[object]) | (float & Iterable[object])`
+ sklearn/gaussian_process/_gpr.py:288:16 error[unresolved-attribute] Attribute `shape` is not defined on `int & <Protocol with members '__iter__'>`, `float & <Protocol with members '__iter__'>` in union `(Unknown & <Protocol with members '__iter__'>) | (int & <Protocol with members '__iter__'>) | (float & <Protocol with members '__iter__'>)`
- sklearn/gaussian_process/_gpr.py:289:30 error[not-subscriptable] Cannot subscript object of type `Iterable[object]` with no `__getitem__` method
+ sklearn/gaussian_process/_gpr.py:289:30 error[not-subscriptable] Cannot subscript object of type `<Protocol with members '__iter__'>` with no `__getitem__` method
- sklearn/gaussian_process/_gpr.py:293:39 error[unresolved-attribute] Attribute `shape` is not defined on `int & Iterable[object]`, `float & Iterable[object]` in union `(Unknown & Iterable[object]) | (int & Iterable[object]) | (float & Iterable[object])`
+ sklearn/gaussian_process/_gpr.py:293:39 error[unresolved-attribute] Attribute `shape` is not defined on `int & <Protocol with members '__iter__'>`, `float & <Protocol with members '__iter__'>` in union `(Unknown & <Protocol with members '__iter__'>) | (int & <Protocol with members '__iter__'>) | (float & <Protocol with members '__iter__'>)`
- sklearn/gaussian_process/kernels.py:1517:55 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Unknown & Iterable[object]) | (int & Iterable[object]) | (float & Iterable[object])`
+ sklearn/gaussian_process/kernels.py:1517:55 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Unknown & <Protocol with members '__iter__'>) | (int & <Protocol with members '__iter__'>) | (float & <Protocol with members '__iter__'>)`

starlette (https://github.com/encode/starlette)
- starlette/routing.py:53:51 error[invalid-assignment] Object of type `(((Request[State], /) -> Awaitable[Response] | Response) & Top[(...) -> Awaitable[object]]) | partial[(Request[State], /) -> CoroutineType[Any, Any, Awaitable[Response] | Response]]` is not assignable to `(Request[State], /) -> Awaitable[Response]`
+ starlette/routing.py:53:51 error[invalid-assignment] Object of type `(((Request[State], /) -> Awaitable[Response] | Response) & Top[(...) -> <Protocol with members '__await__'>]) | partial[(Request[State], /) -> CoroutineType[Any, Any, Awaitable[Response] | Response]]` is not assignable to `(Request[State], /) -> Awaitable[Response]`

Full report with detailed diff (timing results)

@charliermarsh charliermarsh changed the base branch from main to charlie/protocol-property-check May 12, 2026 02:23
@charliermarsh charliermarsh force-pushed the charlie/is-dataclass branch 5 times, most recently from c925317 to 4c76ad7 Compare May 12, 2026 12:26
charliermarsh and others added 5 commits May 12, 2026 08:51
@charliermarsh charliermarsh force-pushed the charlie/is-dataclass branch from 4c76ad7 to 16a0a89 Compare May 12, 2026 12:51
@charliermarsh charliermarsh force-pushed the charlie/protocol-property-check branch from c700e4c to 3edbac5 Compare May 12, 2026 12:52
Co-authored-by: Codex <noreply@openai.com>
@charliermarsh charliermarsh force-pushed the charlie/is-dataclass branch from 16a0a89 to caca96d Compare May 12, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant