Skip to content

WIP: [RFC] Remove ClassType <: SelfType subtyping rule#2658

Draft
fangyi-zhou wants to merge 11 commits intofacebook:mainfrom
fangyi-zhou:self-type-fix
Draft

WIP: [RFC] Remove ClassType <: SelfType subtyping rule#2658
fangyi-zhou wants to merge 11 commits intofacebook:mainfrom
fangyi-zhou:self-type-fix

Conversation

@fangyi-zhou
Copy link
Contributor

Summary

TBD -- running mypy primer to see if this fix causes major regressions

Test Plan

fangyi-zhou and others added 8 commits March 5, 2026 00:43
…nversion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When applying a decorator to a method, the method's `self` parameter has
type `Self@C` (SelfType), but decorators expect `C` (ClassType). This
caused false positive bad-argument-type errors for decorators like
`cache_on_self(fn: Callable[[C], int])`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The overload consistency check triggered variance computation on the
defining class, which needed class fields (including the __init__ being
resolved), causing a cycle that resolved to Any(Implicit). Fix by
skipping the self/cls parameter in the consistency check input signature
comparison, and converting SelfType to ClassType in constructor return
type paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@meta-cla meta-cla bot added the cla signed label Mar 5, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The overload consistency check triggered variance computation on the
defining class, which needed class fields (including the __init__ being
resolved), causing a cycle that resolved to Any(Implicit). Fix by
skipping the self/cls parameter in the consistency check input signature
comparison, and converting SelfType to ClassType in constructor return
type paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fangyi-zhou and others added 2 commits March 5, 2026 21:14
Comparing return types that reference the defining class (e.g.
`partial[...]` in `__new__`) triggers variance computation, which
needs class fields including the overloaded method itself, causing
a cycle that resolves types to Any.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

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

urllib3 (https://github.com/urllib3/urllib3)
+ ERROR src/urllib3/_collections.py:437:16-21: Returned type `HTTPHeaderDict` is not assignable to declared return type `Self@HTTPHeaderDict` [bad-return]
+ ERROR src/urllib3/_collections.py:487:16-22: Returned type `HTTPHeaderDict` is not assignable to declared return type `Self@HTTPHeaderDict` [bad-return]

trio (https://github.com/python-trio/trio)
+ ERROR src/trio/_core/_run.py:503:29-46: Argument `set[CancelStatus]` is not assignable to parameter `iterable` with type `Iterable[Self@CancelStatus]` in function `list.extend` [bad-argument-type]
- ERROR src/trio/_core/_run.py:910:5-26: `(self: Self@CancelScope, new_value: bool) -> None` is not assignable to upper bound `_SupportsCode` of type variable `_T_supports_code` [bad-specialization]
+ ERROR src/trio/_core/_run.py:910:5-26: `(self: CancelScope, new_value: bool) -> None` is not assignable to upper bound `_SupportsCode` of type variable `_T_supports_code` [bad-specialization]
+ ERROR src/trio/_dtls.py:1221:44-1225:14: Unpacked argument `tuple[ReferenceType[Self@DTLSEndpoint], SocketType]` is not assignable to parameter `*args` with type `tuple[ReferenceType[DTLSEndpoint], SocketType]` in function `trio._core._generated_run.spawn_system_task` [bad-argument-type]
+ ERROR src/trio/_path.py:133:32-35: Argument `type[PosixPath] | type[WindowsPath] | type[Self@Path]` is not assignable to parameter `cls` with type `type[Self@Path]` in function `pathlib.PurePath.__new__` [bad-argument-type]

black (https://github.com/psf/black)
+ ERROR src/blib2to3/pytree.py:155:9-158:36: Pyrefly detected conflicting types while breaking a dependency cycle: `Leaf | Node | Self@Base` is not assignable to `Self@Base`. Adding explicit type annotations might possibly help. [bad-assignment]

Expression (https://github.com/cognitedata/Expression)
- ERROR expression/core/pipe.py:273:9-13: Implementation signature `(self: Self@PipeMixin, *args: Any) -> Any` does not accept all arguments that overload signature `(self: _A, fn1: (_A) -> _B, /) -> _B` accepts [inconsistent-overload]
- ERROR expression/core/pipe.py:276:9-13: Implementation signature `(self: Self@PipeMixin, *args: Any) -> Any` does not accept all arguments that overload signature `(self: _A, fn1: (_A) -> _B, fn2: (_B) -> _C, /) -> _C` accepts [inconsistent-overload]
- ERROR expression/core/pipe.py:279:9-13: Implementation signature `(self: Self@PipeMixin, *args: Any) -> Any` does not accept all arguments that overload signature `(self: _A, fn1: (_A) -> _B, fn2: (_B) -> _C, fn3: (_C) -> _D, /) -> _D` accepts [inconsistent-overload]
- ERROR expression/core/pipe.py:282:9-13: Implementation signature `(self: Self@PipeMixin, *args: Any) -> Any` does not accept all arguments that overload signature `(self: _A, fn1: (_A) -> _B, fn2: (_B) -> _C, fn3: (_C) -> _D, fn4: (_D) -> _E, /) -> _E` accepts [inconsistent-overload]
- ERROR expression/core/pipe.py:292:9-13: Implementation signature `(self: Self@PipeMixin, *args: Any) -> Any` does not accept all arguments that overload signature `(self: _A, fn1: (_A) -> _B, fn2: (_B) -> _C, fn3: (_C) -> _D, fn4: (_D) -> _E, fn5: (_E) -> _F, /) -> _F` accepts [inconsistent-overload]
- ERROR expression/core/pipe.py:303:9-13: Implementation signature `(self: Self@PipeMixin, *args: Any) -> Any` does not accept all arguments that overload signature `(self: _A, fn1: (_A) -> _B, fn2: (_B) -> _C, fn3: (_C) -> _D, fn4: (_D) -> _E, fn5: (_E) -> _F, fn6: (_F) -> _G, /) -> _G` accepts [inconsistent-overload]
+ ERROR expression/core/result.py:209:37-42: Argument `_TSourceOut` is not assignable to parameter `error` with type `_TErrorOut` in function `Result.__init__` [bad-argument-type]
+ ERROR expression/core/result.py:211:34-39: Argument `_TErrorOut` is not assignable to parameter `ok` with type `_TSourceOut` in function `Result.__init__` [bad-argument-type]

hydpy (https://github.com/hydpy-dev/hydpy)
- ERROR hydpy/auxs/calibtools.py:1750:9-17: Overload return type `Add | Multiply | MultiplyIUH | Replace | ReplaceIUH` is not assignable to implementation return type `Add | Multiply` [inconsistent-overload]
+ ERROR hydpy/core/masktools.py:99:16-33: Returned type `CustomMask` is not assignable to declared return type `Self@CustomMask` [bad-return]
+ ERROR hydpy/core/masktools.py:163:16-31: Returned type `DefaultMask` is not assignable to declared return type `Self@DefaultMask` [bad-return]
+ ERROR hydpy/core/masktools.py:166:16-51: Returned type `DefaultMask` is not assignable to declared return type `Self@DefaultMask` [bad-return]
+ ERROR hydpy/core/timetools.py:211:32-35: Argument `type[TypeDate]` is not assignable to parameter `cls` with type `type[Self@Date]` in function `object.__new__` [bad-argument-type]
+ ERROR hydpy/core/timetools.py:254:32-35: Argument `type[TypeDate]` is not assignable to parameter `cls` with type `type[Self@Date]` in function `object.__new__` [bad-argument-type]
+ ERROR hydpy/core/timetools.py:354:32-35: Argument `type[TypeDate]` is not assignable to parameter `cls` with type `type[Self@Date]` in function `object.__new__` [bad-argument-type]
+ ERROR hydpy/core/timetools.py:1242:40-43: Argument `type[TypePeriod]` is not assignable to parameter `cls` with type `type[Self@Period]` in function `object.__new__` [bad-argument-type]
+ ERROR hydpy/core/timetools.py:1269:32-35: Argument `type[TypePeriod]` is not assignable to parameter `cls` with type `type[Self@Period]` in function `object.__new__` [bad-argument-type]
+ ERROR hydpy/core/timetools.py:1295:32-35: Argument `type[TypePeriod]` is not assignable to parameter `cls` with type `type[Self@Period]` in function `object.__new__` [bad-argument-type]
+ ERROR hydpy/core/timetools.py:1349:32-35: Argument `type[TypePeriod]` is not assignable to parameter `cls` with type `type[Self@Period]` in function `object.__new__` [bad-argument-type]

archinstall (https://github.com/archlinux/archinstall)
+ ERROR archinstall/lib/models/device.py:226:10-52: Returned type `PartitionTable` is not assignable to declared return type `Self@PartitionTable` [bad-return]
+ ERROR archinstall/lib/models/device.py:426:10-75: `-` is not supported between `Self@Size` and `Size` [unsupported-operation]
+ ERROR archinstall/lib/models/device.py:429:10-52: `-` is not supported between `Self@Size` and `Size` [unsupported-operation]
+ ERROR archinstall/lib/models/device.py:648:10-14: Returned type `list[SubvolumeModification]` is not assignable to declared return type `list[Self@SubvolumeModification]` [bad-return]
+ ERROR archinstall/lib/models/device.py:1415:10-1420:4: Returned type `dict[str, EncryptionType]` is not assignable to declared return type `dict[str, Self@EncryptionType]` [bad-return]
+ ERROR archinstall/lib/models/mirrors.py:209:10-17: Returned type `list[CustomRepository]` is not assignable to declared return type `list[Self@CustomRepository]` [bad-return]
+ ERROR archinstall/lib/models/mirrors.py:230:10-17: Returned type `list[CustomServer]` is not assignable to declared return type `list[Self@CustomServer]` [bad-return]
+ ERROR archinstall/lib/models/network.py:224:10-18: Returned type `list[WifiConfiguredNetwork]` is not assignable to declared return type `list[Self@WifiConfiguredNetwork]` [bad-return]

ppb-vector (https://github.com/ppb/ppb-vector)
- ERROR ppb_vector/__init__.py:110:9-16: Overload return type `None` is not assignable to implementation return type `Self@Vector` [inconsistent-overload]
- ERROR ppb_vector/__init__.py:113:9-16: Overload return type `None` is not assignable to implementation return type `Self@Vector` [inconsistent-overload]

core (https://github.com/home-assistant/core)
+ ERROR homeassistant/components/logbook/queries/all.py:56:12-60:6: Returned type `HasHints` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/logbook/queries/common.py:257:12-261:6: Returned type `HasHints` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/logbook/queries/common.py:266:12-270:6: Returned type `HasHints` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/logbook/queries/devices.py:44:12-75: Returned type `GenerativeSelect` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/logbook/queries/entities.py:54:12-75: Returned type `GenerativeSelect` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/logbook/queries/entities.py:145:12-153:6: Returned type `HasHints` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/logbook/queries/entities_and_devices.py:57:12-75: Returned type `GenerativeSelect` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:195:16-73: Returned type `GenerativeSelect` is not assignable to declared return type `CompoundSelect[Unknown] | Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:214:12-219:83: Returned type `GenerativeSelect` is not assignable to declared return type `CompoundSelect[Unknown] | Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:428:16-20: Returned type `GenerativeSelect` is not assignable to declared return type `CompoundSelect[Unknown] | Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:524:9-546:42: Returned type `GenerativeSelect` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:554:9-568:42: Returned type `GenerativeSelect` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:786:16-20: Returned type `GenerativeSelect` is not assignable to declared return type `Select[Unknown]` [bad-return]
+ ERROR homeassistant/components/recorder/history/__init__.py:787:12-26: Object of class `GenerativeSelect` has no attribute `outerjoin` [missing-attribute]
+ ERROR homeassistant/components/recorder/migration.py:2080:21-2089:28: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/migration.py:2095:21-2104:28: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/migration.py:2117:21-2124:28: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:173:13-175:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:185:13-187:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:196:13-198:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:209:13-211:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:222:13-224:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:235:13-237:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:248:13-250:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:429:13-447:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:590:13-592:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:601:13-603:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:653:13-655:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:677:13-679:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:698:13-700:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/recorder/queries.py:709:13-711:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR homeassistant/components/sonos/speaker.py:1038:34-41: Argument `SonosSpeaker` is not assignable to parameter `object` with type `Self@SonosSpeaker` in function `list.append` [bad-argument-type]
+ ERROR homeassistant/components/sonos/speaker.py:1040:16-21: Returned type `list[SonosSpeaker] | list[Self@SonosSpeaker]` is not assignable to declared return type `list[SonosSpeaker]` [bad-return]
+ ERROR homeassistant/components/usage_prediction/common_control.py:218:40-47: No matching overload found for function `sqlalchemy.engine.base.Connection.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
- ERROR homeassistant/core.py:566:9-22: Implementation signature `(self: Self@HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` does not accept all arguments that overload signature `(self: Self@HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R], *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` accepts [inconsistent-overload]
+ ERROR homeassistant/core.py:566:9-22: Implementation signature `(self: HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` does not accept all arguments that overload signature `(self: HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R], *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` accepts [inconsistent-overload]
- ERROR homeassistant/core.py:575:9-22: Implementation signature `(self: Self@HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` does not accept all arguments that overload signature `(self: Self@HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R, *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` accepts [inconsistent-overload]
+ ERROR homeassistant/core.py:575:9-22: Implementation signature `(self: HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` does not accept all arguments that overload signature `(self: HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R, *args: *_Ts, *, eager_start: bool = False) -> Future[_R] | None` accepts [inconsistent-overload]
- ERROR homeassistant/core.py:909:9-22: Implementation signature `(self: Self@HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts) -> Future[_R] | None` does not accept all arguments that overload signature `(self: Self@HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R], *args: *_Ts) -> Future[_R] | None` accepts [inconsistent-overload]
+ ERROR homeassistant/core.py:909:9-22: Implementation signature `(self: HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts) -> Future[_R] | None` does not accept all arguments that overload signature `(self: HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R], *args: *_Ts) -> Future[_R] | None` accepts [inconsistent-overload]
- ERROR homeassistant/core.py:915:9-22: Implementation signature `(self: Self@HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts) -> Future[_R] | None` does not accept all arguments that overload signature `(self: Self@HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R, *args: *_Ts) -> Future[_R] | None` accepts [inconsistent-overload]
+ ERROR homeassistant/core.py:915:9-22: Implementation signature `(self: HomeAssistant, target: ((**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R) | Coroutine[Any, Any, _R], *args: *_Ts) -> Future[_R] | None` does not accept all arguments that overload signature `(self: HomeAssistant, target: (**tuple[*_Ts]) -> Coroutine[Any, Any, _R] | _R, *args: *_Ts) -> Future[_R] | None` accepts [inconsistent-overload]

tornado (https://github.com/tornadoweb/tornado)
- ERROR tornado/test/gen_test.py:793:5-14: No matching overload found for function `tornado.testing.gen_test` called with arguments: ((self: Self@WaitIteratorTest) -> None) [no-matching-overload]
+ ERROR tornado/test/gen_test.py:793:5-14: No matching overload found for function `tornado.testing.gen_test` called with arguments: ((self: WaitIteratorTest) -> None) [no-matching-overload]
- ERROR tornado/test/queues_test.py:178:5-14: No matching overload found for function `tornado.testing.gen_test` called with arguments: ((self: Self@QueuePutTest) -> None) [no-matching-overload]
+ ERROR tornado/test/queues_test.py:178:5-14: No matching overload found for function `tornado.testing.gen_test` called with arguments: ((self: QueuePutTest) -> None) [no-matching-overload]
- ERROR tornado/test/testing_test.py:242:5-14: No matching overload found for function `tornado.testing.gen_test` called with arguments: ((self: Self@GenTest) -> None) [no-matching-overload]
+ ERROR tornado/test/testing_test.py:242:5-14: No matching overload found for function `tornado.testing.gen_test` called with arguments: ((self: GenTest) -> None) [no-matching-overload]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ ERROR bson/son.py:71:36-39: Argument `type[SON[_Key, _Value]]` is not assignable to parameter `cls` with type `type[Self@SON]` in function `dict.__new__` [bad-argument-type]

pyodide (https://github.com/pyodide/pyodide)
- ERROR src/py/_pyodide/_core_docs.py:971:9-20: Overload return type `object` is not assignable to implementation return type `Never` [inconsistent-overload]
- ERROR src/py/_pyodide/_core_docs.py:974:9-20: Overload return type `JsArray[object]` is not assignable to implementation return type `Never` [inconsistent-overload]
+ ERROR src/py/_pyodide/_core_docs.py:1265:34-45: Argument `type[JsException]` is not assignable to parameter `cls` with type `type[Self@JsException]` in function `JsProxy.__new__` [bad-argument-type]

pandera (https://github.com/pandera-dev/pandera)
-  WARN pandera/api/dataframe/model.py:246:20-72: Redundant cast: `DataFrameBase[Self@DataFrameModel]` is the same type as `DataFrameBase[Self@DataFrameModel]` [redundant-cast]
-  WARN pandera/api/pyspark/model.py:151:20-72: Redundant cast: `DataFrameBase[Self@DataFrameModel]` is the same type as `DataFrameBase[Self@DataFrameModel]` [redundant-cast]
+ ERROR pandera/api/pyspark/model.py:124:9-17: Class member `DataFrameModel.validate` overrides parent class `DataFrameModel` in an inconsistent manner [bad-override]

operator (https://github.com/canonical/operator)
+ ERROR ops/framework.py:391:34-63: `CallableProxyType[Never]` is not assignable to attribute `framework` with type `Framework` [bad-assignment]

rich (https://github.com/Textualize/rich)
+ ERROR rich/segment.py:461:33-72: Argument `list[list[Self@Segment]]` is not assignable to parameter `iterable` with type `Iterable[list[Segment]]` in function `list.extend` [bad-argument-type]
+ ERROR rich/style.py:218:36-41: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR rich/style.py:239:36-41: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR rich/style.py:478:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR rich/style.py:630:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR rich/style.py:653:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR rich/style.py:676:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR rich/style.py:734:41-46: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ERROR ddtrace/internal/logger.py:68:9-71:45: Pyrefly detected conflicting types while breaking a dependency cycle: `LoggerPrefix | Self@LoggerPrefix` is not assignable to `Self@LoggerPrefix`. Adding explicit type annotations might possibly help. [bad-assignment]

asynq (https://github.com/quora/asynq)
- ERROR asynq/generator.py:127:16-25: Argument `AsyncDecorator[Any, [self: Self@_AsyncGenerator, value: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/generator.py:127:16-25: Argument `AsyncDecorator[Any, [self: _AsyncGenerator, value: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/generator.py:148:16-32: Argument `AsyncDecorator[Any, [self: Self@_AsyncGenerator, first_task: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/generator.py:148:16-32: Argument `AsyncDecorator[Any, [self: _AsyncGenerator, first_task: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_asynq_to_async.py:226:27-33: Argument `AsyncDecorator[Any, [self: Self@test_proxy_and_bind.B, x: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_asynq_to_async.py:226:27-33: Argument `AsyncDecorator[Any, [self: test_proxy_and_bind.B, x: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_decorators.py:67:16-36: Argument `AsyncDecorator[Any, [cls: type[Self@MyClass], number: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_decorators.py:67:16-36: Argument `AsyncDecorator[Any, [cls: type[MyClass], number: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_decorators.py:73:16-30: Argument `AsyncDecorator[Any, [cls: type[Self@MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_decorators.py:73:16-30: Argument `AsyncDecorator[Any, [cls: type[MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_decorators.py:74:23-37: Argument `AsyncDecorator[Any, [cls: type[Self@MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_decorators.py:74:23-37: Argument `AsyncDecorator[Any, [cls: type[MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_decorators.py:75:16-27: Argument `PureAsyncDecorator[Any, [cls: type[Self@MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.PureAsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_decorators.py:75:16-27: Argument `PureAsyncDecorator[Any, [cls: type[MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.PureAsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_decorators.py:76:23-34: Argument `PureAsyncDecorator[Any, [cls: type[Self@MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.PureAsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_decorators.py:76:23-34: Argument `PureAsyncDecorator[Any, [cls: type[MyClass]]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.PureAsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_multiple_inheritance.py:42:9-15: Class member `Child.method` overrides parent class `Parent1` in an inconsistent manner [bad-override]
+ ERROR asynq/tests/test_multiple_inheritance.py:42:9-15: Class member `Child.method` overrides parent class `Parent2` in an inconsistent manner [bad-override]
- ERROR asynq/tests/test_multiple_inheritance.py:43:15-40: Argument `AsyncDecorator[Any, [self: Self@Child]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_multiple_inheritance.py:43:15-40: Argument `AsyncDecorator[Any, [self: Parent1]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:189:17-36: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:192:22-35: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:193:22-35: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:194:22-35: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:195:22-35: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:196:22-35: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:197:22-35: Argument `AsyncDecorator[Any, [self: UnhashableAcached, index: Unknown]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:199:22-37: Argument `AsyncDecorator[Any, [self: UnhashableAcached, x: int | Unknown = 1, y: int | Unknown = 2, z: int | Unknown = 3]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:200:22-37: Argument `AsyncDecorator[Any, [self: UnhashableAcached, x: int | Unknown = 1, y: int | Unknown = 2, z: int | Unknown = 3]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:201:23-38: Argument `AsyncDecorator[Any, [self: UnhashableAcached, x: int | Unknown = 1, y: int | Unknown = 2, z: int | Unknown = 3]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:205:22-41: Argument `AsyncDecorator[Any, [self: UnhashableAcached, *, arg: int | Unknown = 1]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:623:24-41: Argument `AsyncDecorator[Any, [self: Self@DeduplicateClassWrapper]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_tools.py:623:24-41: Argument `AsyncDecorator[Any, [self: DeduplicateClassWrapper]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
- ERROR asynq/tests/test_tools.py:623:51-67: Argument `AsyncDecorator[Any, [self: Self@DeduplicateClassWrapper]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]
+ ERROR asynq/tests/test_tools.py:623:51-67: Argument `AsyncDecorator[Any, [self: DeduplicateClassWrapper]]` is not assignable to parameter `self` with type `PureAsyncDecorator[Any, Concatenate[Any, _P2]]` in function `asynq.decorators.AsyncDecorator.__get__` [bad-argument-type]

mkdocs (https://github.com/mkdocs/mkdocs)
- ERROR mkdocs/config/config_options.py:95:37-84: `partial[Config]` is not assignable to attribute `config_class` with type `type[Any]` [bad-assignment]
+ ERROR mkdocs/config/config_options.py:95:37-84: `partial[Config]` is not assignable to attribute `config_class` with type `type[SomeConfig]` [bad-assignment]

discord.py (https://github.com/Rapptz/discord.py)
+ ERROR discord/interactions.py:686:20-32: No matching overload found for function `discord.utils.CachedSlotProperty.__get__` called with arguments: (Interaction[ClientT], type[Interaction]) [no-matching-overload]

pydantic (https://github.com/pydantic/pydantic)
+ ERROR pydantic/fields.py:842:16-22: Returned type `FieldInfo` is not assignable to declared return type `Self@FieldInfo` [bad-return]
+ ERROR pydantic/fields.py:1563:16-1577:10: Returned type `ComputedFieldInfo` is not assignable to declared return type `Self@ComputedFieldInfo` [bad-return]
+ ERROR pydantic/main.py:988:16-17: Returned type `BaseModel` is not assignable to declared return type `Self@BaseModel` [bad-return]
+ ERROR pydantic/main.py:1009:16-17: Returned type `BaseModel` is not assignable to declared return type `Self@BaseModel` [bad-return]
+ ERROR pydantic/root_model.py:106:16-17: Returned type `RootModel[Unknown]` is not assignable to declared return type `Self@RootModel` [bad-return]
+ ERROR pydantic/root_model.py:116:16-17: Returned type `RootModel[Unknown]` is not assignable to declared return type `Self@RootModel` [bad-return]

jinja (https://github.com/pallets/jinja)
+ ERROR src/jinja2/nodes.py:217:25-48: Argument `Iterator[Node]` is not assignable to parameter `iterable` with type `Iterable[Self@Node]` in function `collections.deque.extend` [bad-argument-type]
+ ERROR src/jinja2/nodes.py:228:25-48: Argument `Iterator[Node]` is not assignable to parameter `iterable` with type `Iterable[Self@Node]` in function `collections.deque.extend` [bad-argument-type]
+ ERROR src/jinja2/nodes.py:237:25-48: Argument `Iterator[Node]` is not assignable to parameter `iterable` with type `Iterable[Self@Node]` in function `collections.deque.extend` [bad-argument-type]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
- ERROR mitmproxy/proxy/mode_servers.py:85:5-20: No matching overload found for function `contextlib.contextmanager` called with arguments: ((self: Self@ServerManager, connection_id: str | tuple[Unknown, ...], handler: ProxyConnectionHandler) -> None) [no-matching-overload]
+ ERROR mitmproxy/proxy/mode_servers.py:85:5-20: No matching overload found for function `contextlib.contextmanager` called with arguments: ((self: ServerManager, connection_id: str | tuple[Unknown, ...], handler: ProxyConnectionHandler) -> None) [no-matching-overload]

streamlit (https://github.com/streamlit/streamlit)
- ERROR lib/streamlit/runtime/state/query_params_proxy.py:88:9-15: Implementation signature `(self: Self@QueryParamsProxy, params: tuple[()] | Unknown = ..., /, **kwds: Unknown) -> None` does not accept all arguments that overload signature `(self: Self@QueryParamsProxy, **kwds: Iterable[str] | str) -> None` accepts [inconsistent-overload]

dedupe (https://github.com/dedupeio/dedupe)
- ERROR dedupe/api.py:140:9-18: Overload return type `Iterable[tuple[tuple[int, ...], ndarray[tuple[Any, ...], dtype[float64]] | tuple[float, ...]]]` is not assignable to implementation return type `list[tuple[tuple[int, ...], ndarray[tuple[Any, ...], dtype[float64]] | tuple[float, ...]]]` [inconsistent-overload]
- ERROR dedupe/api.py:146:9-18: Overload return type `Iterable[tuple[tuple[str, ...], ndarray[tuple[Any, ...], dtype[float64]] | tuple[float, ...]]]` is not assignable to implementation return type `list[tuple[tuple[int, ...], ndarray[tuple[Any, ...], dtype[float64]] | tuple[float, ...]]]` [inconsistent-overload]
- ERROR dedupe/api.py:199:9-24: Overload return type `Iterable[tuple[tuple[int, ...], ndarray[tuple[Any, ...], dtype[float64]] | tuple[float, ...]]]` is not assignable to implementation return type `Generator[tuple[tuple[Unknown], tuple[float]] | tuple[Unknown, Unknown], Unknown]` [inconsistent-overload]
- ERROR dedupe/api.py:205:9-24: Overload return type `Iterable[tuple[tuple[str, ...], ndarray[tuple[Any, ...], dtype[float64]] | tuple[float, ...]]]` is not assignable to implementation return type `Generator[tuple[tuple[Unknown], tuple[float]] | tuple[Unknown, Unknown], Unknown]` [inconsistent-overload]
- ERROR dedupe/api.py:779:9-15: Overload return type `Iterator[list[tuple[tuple[int, Mapping[str, Any]], tuple[int, Mapping[str, Any]]]]]` is not assignable to implementation return type `Generator[list[tuple[tuple[Any, Unknown], tuple[Any, Mapping[str, Any]]]], Unknown]` [inconsistent-overload]
- ERROR dedupe/api.py:782:9-15: Overload return type `Iterator[list[tuple[tuple[str, Mapping[str, Any]], tuple[str, Mapping[str, Any]]]]]` is not assignable to implementation return type `Generator[list[tuple[tuple[Any, Unknown], tuple[Any, Mapping[str, Any]]]], Unknown]` [inconsistent-overload]
- ERROR dedupe/api.py:998:9-31: Overload return type `Iterable[tuple[int, tuple[tuple[int, float], ...]]]` is not assignable to implementation return type `Generator[tuple[Unknown, tuple[tuple[RecordID, float], ...]] | tuple[Unknown, tuple[()]], Unknown]` [inconsistent-overload]
- ERROR dedupe/api.py:1003:9-31: Overload return type `Iterable[tuple[str, tuple[tuple[str, float], ...]]]` is not assignable to implementation return type `Generator[tuple[Unknown, tuple[tuple[RecordID, float], ...]] | tuple[Unknown, tuple[()]], Unknown]` [inconsistent-overload]
- ERROR dedupe/training.py:222:9-21: Overload return type `dict[Predicate, frozenset[tuple[int, int]]]` is not assignable to implementation return type `dict[Predicate, frozenset[tuple[RecordID, RecordID]]]` [inconsistent-overload]
- ERROR dedupe/training.py:227:9-21: Overload return type `dict[Predicate, frozenset[tuple[str, str]]]` is not assignable to implementation return type `dict[Predicate, frozenset[tuple[RecordID, RecordID]]]` [inconsistent-overload]

bokeh (https://github.com/bokeh/bokeh)
- ERROR src/bokeh/server/views/session_handler.py:83:5-19: Argument `(self: Self@SessionHandler) -> Coroutine[Unknown, Unknown, ServerSession]` is not assignable to parameter `method` with type `(...) -> Awaitable[None] | None` in function `tornado.web.authenticated` [bad-argument-type]
+ ERROR src/bokeh/server/views/session_handler.py:83:5-19: Argument `(self: SessionHandler) -> Coroutine[Unknown, Unknown, ServerSession]` is not assignable to parameter `method` with type `(...) -> Awaitable[None] | None` in function `tornado.web.authenticated` [bad-argument-type]

parso (https://github.com/davidhalter/parso)
+ ERROR parso/tree.py:41:9-42:33: Pyrefly detected conflicting types while breaking a dependency cycle: `BaseNode | Self@NodeOrLeaf` is not assignable to `Self@NodeOrLeaf`. Adding explicit type annotations might possibly help. [bad-assignment]

strawberry (https://github.com/strawberry-graphql/strawberry)
+ ERROR strawberry/types/base.py:141:16-40: Returned type `StrawberryContainer` is not assignable to declared return type `Self@StrawberryContainer` [bad-return]
+ ERROR strawberry/types/field.py:192:16-25: Returned type `StrawberryField` is not assignable to declared return type `Self@StrawberryField` [bad-return]

isort (https://github.com/pycqa/isort)
+ ERROR isort/output.py:667:35-47: No matching overload found for function `str.__new__` called with arguments: (type[_LineWithComments], Any) [no-matching-overload]

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ ERROR src/hydra_zen/wrapper/_implementations.py:1579:20-22: Returned type `ZenStore` is not assignable to declared return type `F | Self@ZenStore` [bad-return]

prefect (https://github.com/PrefectHQ/prefect)
- ERROR src/integrations/prefect-dask/prefect_dask/task_runners.py:453:9-12: Overload return type `PrefectFutureList[PrefectDaskFuture[object]]` is not assignable to implementation return type `PrefectFutureList[PrefectConcurrentFuture[Any]]` [inconsistent-overload]
- ERROR src/integrations/prefect-dask/prefect_dask/task_runners.py:461:9-12: Overload return type `PrefectFutureList[PrefectDaskFuture[object]]` is not assignable to implementation return type `PrefectFutureList[PrefectConcurrentFuture[Any]]` [inconsistent-overload]
- ERROR src/integrations/prefect-dbt/prefect_dbt/cloud/jobs.py:865:26-46: Argument `(self: Self@DbtCloudJobRun) -> Coroutine[Any, Any, int] | int` is not assignable to parameter `get_state_fn` with type `Awaitable[(...) -> Unknown]` in function `DbtCloudJobRun._wait_until_state` [bad-argument-type]
+ ERROR src/integrations/prefect-dbt/prefect_dbt/cloud/jobs.py:865:26-46: Argument `(self: DbtCloudJobRun) -> Coroutine[Any, Any, int] | int` is not assignable to parameter `get_state_fn` with type `Awaitable[(...) -> Unknown]` in function `DbtCloudJobRun._wait_until_state` [bad-argument-type]
+ ERROR src/integrations/prefect-docker/prefect_docker/worker.py:612:70-83: Argument `BaseJobConfiguration` is not assignable to parameter `configuration` with type `DockerWorkerJobConfiguration` in function `DockerWorker.run` [bad-argument-type]
- ERROR src/integrations/prefect-kubernetes/prefect_kubernetes/jobs.py:480:5-42: Argument `(self: Self@KubernetesJobRun, print_func: ((...) -> Unknown) | None = None) -> Awaitable[Unknown] | Unknown` is not assignable to parameter with type `(self: Self@KubernetesJobRun, print_func: ((...) -> Unknown) | None = None) -> None` [bad-argument-type]
+ ERROR src/integrations/prefect-kubernetes/prefect_kubernetes/jobs.py:480:5-42: Argument `(self: KubernetesJobRun, print_func: ((...) -> Unknown) | None = None) -> Awaitable[Unknown] | Unknown` is not assignable to parameter with type `(self: Self@KubernetesJobRun, print_func: ((...) -> Unknown) | None = None) -> None` [bad-argument-type]
- ERROR src/integrations/prefect-kubernetes/prefect_kubernetes/jobs.py:586:5-30: Argument `(self: Self@KubernetesJob) -> Awaitable[Unknown] | Unknown` is not assignable to parameter with type `(self: Self@KubernetesJob) -> KubernetesJobRun` [bad-argument-type]
+ ERROR src/integrations/prefect-kubernetes/prefect_kubernetes/jobs.py:586:5-30: Argument `(self: KubernetesJob) -> Awaitable[Unknown] | Unknown` is not assignable to parameter with type `(self: Self@KubernetesJob) -> KubernetesJobRun` [bad-argument-type]
- ERROR src/integrations/prefect-ray/prefect_ray/task_runners.py:225:9-15: Overload return type `PrefectRayFuture[object]` is not assignable to implementation return type `PrefectRayFuture[Coroutine[Any, Any, object]]` [inconsistent-overload]
- ERROR src/integrations/prefect-ray/prefect_ray/task_runners.py:293:9-12: Overload return type `PrefectFutureList[PrefectRayFuture[object]]` is not assignable to implementation return type `PrefectFutureList[PrefectRayFuture[Coroutine[Any, Any, object]]]` [inconsistent-overload]
- ERROR src/prefect/_internal/compatibility/deprecated.py:264:21-61: No matching overload found for function `pydantic._internal._utils.deprecated_instance_property.__get__` called with arguments: (None, type[BaseModel]) [no-matching-overload]
+ ERROR src/prefect/automations.py:110:5-29: Argument `(self: Automation) -> Automation` is not assignable to parameter with type `(self: Self@Automation) -> Self@Automation` [bad-argument-type]
+ ERROR src/prefect/automations.py:235:5-27: Argument `(cls: type[Automation], id: UUID | None = None, name: str | None = None) -> Automation` is not assignable to parameter with type `(cls: type[Self@Automation], id: UUID, name: str | None = ...) -> Self@Automation` [bad-argument-type]
- ERROR src/prefect/client/schemas/objects.py:313:5-29: Argument `(self: Self@State, raise_on_failure: bool = True, retry_result_failure: bool = True) -> Exception | R` is not assignable to parameter with type `(self: State[R], raise_on_failure: Literal[True] = ..., retry_result_failure: bool = ...) -> R` [bad-argument-type]
+ ERROR src/prefect/client/schemas/objects.py:313:5-29: Argument `(self: State[R], raise_on_failure: bool = True, retry_result_failure: bool = True) -> Exception | R` is not assignable to parameter with type `(self: State[R], raise_on_failure: Literal[True] = ..., retry_result_failure: bool = ...) -> R` [bad-argument-type]
- ERROR src/prefect/flows.py:2275:9-17: Implementation signature `(Self@InfrastructureBoundFlow, ParamSpec(P)) -> Coroutine[Unknown, Unknown, State[R] | R] | State[R] | R` does not accept all arguments that overload signature `(Flow[P, NoReturn], ParamSpec(P)) -> None` accepts [inconsistent-overload]
- ERROR src/prefect/flows.py:2281:9-17: Implementation signature `(Self@InfrastructureBoundFlow, ParamSpec(P)) -> Coroutine[Unknown, Unknown, State[R] | R] | State[R] | R` does not accept all arguments that overload signature `(Flow[P, Coroutine[Any, Any, T]], ParamSpec(P)) -> Coroutine[Any, Any, T]` accepts [inconsistent-overload]
- ERROR src/prefect/flows.py:2288:9-17: Implementation signature `(Self@InfrastructureBoundFlow, ParamSpec(P)) -> Coroutine[Unknown, Unknown, State[R] | R] | State[R] | R` does not accept all arguments that overload signature `(Flow[P, T], ParamSpec(P)) -> T` accepts [inconsistent-overload]
- ERROR src/prefect/flows.py:2295:9-17: Implementation signature `(Self@InfrastructureBoundFlow, ParamSpec(P)) -> Coroutine[Unknown, Unknown, State[R] | R] | State[R] | R` does not accept all arguments that overload signature `(Flow[P, Coroutine[Any, Any, T]], ParamSpec(P)) -> Awaitable[State[T]]` accepts [inconsistent-overload]
- ERROR src/prefect/flows.py:2303:9-17: Implementation signature `(Self@InfrastructureBoundFlow, ParamSpec(P)) -> Coroutine[Unknown, Unknown, State[R] | R] | State[R] | R` does not accept all arguments that overload signature `(Flow[P, T], ParamSpec(P)) -> State[T]` accepts [inconsistent-overload]
+ ERROR src/prefect/input/run_input.py:242:5-27: Argument `(cls: type[BaseRunInput], keyset: dict[Literal['description', 'response', 'schema'], str], flow_run_id: UUID | None = None) -> BaseRunInput` is not assignable to parameter with type `(cls: type[Self@BaseRunInput], keyset: dict[Literal['description', 'response', 'schema'], str], flow_run_id: UUID | None = None) -> Self@BaseRunInput` [bad-argument-type]
- ERROR src/prefect/input/run_input.py:293:30-46: No matching overload found for function `pydantic._internal._utils.deprecated_instance_property.__get__` called with arguments: (None, type[RunInput]) [no-matching-overload]
+ ERROR src/prefect/results.py:397:5-38: Argument `(self: ResultStore, flow: Flow[Ellipsis, Any]) -> ResultStore` is not assignable to parameter with type `(self: Self@ResultStore, flow: Flow[Ellipsis, Any]) -> Self@ResultStore` [bad-argument-type]
+ ERROR src/prefect/results.py:473:5-38: Argument `(self: ResultStore, task: Task[P, R]) -> ResultStore` is not assignable to parameter with type `(self: Self@ResultStore, task: Task[Ellipsis, Unknown]) -> Self@ResultStore` [bad-argument-type]
+ ERROR src/prefect/server/api/deployments.py:425:17-432:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
- ERROR src/prefect/server/api/run_history.py:159:14-42: Type `Result[tuple[Any, Any, Unknown]]` is not awaitable [not-async]
+ ERROR src/prefect/server/api/run_history.py:159:35-42: No matching overload found for function `sqlalchemy.orm.session.Session.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/api/server.py:847:16-36: Returned type `SubprocessASGIServer` is not assignable to declared return type `Self@SubprocessASGIServer` [bad-return]
+ ERROR src/prefect/server/api/ui/flow_runs.py:119:40-47: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/api/ui/flows.py:65:40-47: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/api/ui/task_runs.py:148:39-46: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_05_10_145956_1c9390e2f9c6_replace_version_with_checksum_and_.py:112:13-114:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_05_10_145956_1c9390e2f9c6_replace_version_with_checksum_and_.py:127:13-129:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_05_10_145956_1c9390e2f9c6_replace_version_with_checksum_and_.py:137:17-139:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_05_26_135743_724e6dcc6b5d_add_block_schema_capabilities.py:43:17-45:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_05_26_135743_724e6dcc6b5d_add_block_schema_capabilities.py:73:17-75:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_05_28_081821_2fe6fe6ca16e_adds_block_schema_references_and_block_.py:175:13-177:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_07_06_152528_4cdc2ba709a4_migrates_block_schemas_with_new_secrets_.py:136:21-138:28: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_07_19_160058_bb4dc90d3e29_renames_existing_block_types.py:45:13-47:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_07_25_214717_4ff2f2bf81f4_adds_block_type_slug.py:53:13-55:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/postgresql/2022_07_25_214717_4ff2f2bf81f4_adds_block_type_slug.py:66:17-68:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_04_25_135207_b75d279ba985_replace_version_with_checksum.py:119:13-121:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_04_25_135207_b75d279ba985_replace_version_with_checksum.py:135:13-137:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_04_25_135207_b75d279ba985_replace_version_with_checksum.py:145:17-147:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_05_19_165808_33439667aeea_add_block_schema_capabilities.py:45:17-47:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_05_19_165808_33439667aeea_add_block_schema_capabilities.py:86:17-88:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_05_28_081650_e73c6f1fe752_adds_block_schema_referecnes_and_block_.py:189:13-191:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_07_06_142824_e2dae764a603_migrates_block_schemas_with_new_secrets_.py:135:21-137:28: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_07_19_153432_628a873f0d1a_renames_existing_block_types.py:45:13-47:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_07_25_142515_f335f9633eec_adds_block_type_slug.py:56:13-58:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/_migrations/versions/sqlite/2022_07_25_142515_f335f9633eec_adds_block_type_slug.py:69:17-71:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
- ERROR src/prefect/server/database/dependencies.py:251:13-20: Overload return type `DBInjector[object, object, object]` is not assignable to implementation return type `DBInjector[object, Concatenate[PrefectDBInterface, object], object] | DBInjector[None, Concatenate[PrefectDBInterface, object], object]` [inconsistent-overload]
+ ERROR src/prefect/server/database/query_components.py:201:16-21: Returned type `GenerativeSelect` is not assignable to declared return type `Select[tuple[FlowRun, UUID]]` [bad-return]
+ ERROR src/prefect/server/database/query_components.py:513:40-47: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/database/query_components.py:577:13-585:24: Returned type `GenerativeSelect` is not assignable to declared return type `Select[tuple[datetime, datetime]]` [bad-return]
+ ERROR src/prefect/server/database/query_components.py:600:13-606:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/database/query_components.py:871:13-875:20: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/events/counting.py:217:30-60: Object of class `GenerativeSelect` has no attribute `select_from` [missing-attribute]
+ ERROR src/prefect/server/events/counting.py:265:16-28: Returned type `GenerativeSelect` is not assignable to declared return type `Select[tuple[str, str, Unknown, Unknown, int]]` [bad-return]
+ ERROR src/prefect/server/events/models/automations.py:55:17-28: Object of class `GenerativeSelect` has no attribute `where` [missing-attribute]
+ ERROR src/prefect/server/events/models/automations.py:61:35-42: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect | Unknown) [no-matching-overload]
+ ERROR src/prefect/server/events/models/automations.py:212:9-214:16: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/events/models/automations.py:238:26-242:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/models/automations.py:243:26-247:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/models/automations.py:248:26-252:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/models/automations.py:255:26-259:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/models/automations.py:312:9-314:16: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/events/models/automations.py:330:26-337:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase, execution_options=dict[str, bool]) [no-matching-overload]
+ ERROR src/prefect/server/events/models/automations.py:362:9-368:31: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/events/models/automations.py:431:26-433:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/models/composite_trigger_child_firing.py:61:9-70:31: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/events/ordering/db.py:78:34-83:14: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/ordering/db.py:114:34-119:14: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/storage/database.py:196:55-76: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/events/triggers.py:797:26-803:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/triggers.py:828:39-46: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
+ ERROR src/prefect/server/events/triggers.py:893:9-903:31: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/events/triggers.py:948:9-960:31: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/events/triggers.py:1009:9-1020:31: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/events/triggers.py:1049:26-1055:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/events/triggers.py:1064:26-1066:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/models/artifacts.py:31:9-33:31: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/models/artifacts.py:89:9-92:27: Object of class `GenerativeSelect` has no attribute `execution_options` [missing-attribute]
+ ERROR src/prefect/server/models/artifacts.py:281:9-14: Argument `GenerativeSelect` is not assignable to parameter `query` with type `Select[@_]` in function `_apply_artifact_filters` [bad-argument-type]
+ ERROR src/prefect/server/models/artifacts.py:294:35-42: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect | Select[Unknown]) [no-matching-overload]
+ ERROR src/prefect/server/models/artifacts.py:328:9-14: Argument `GenerativeSelect` is not assignable to parameter `query` with type `Select[@_]` in function `_apply_artifact_collection_filters` [bad-argument-type]
+ ERROR src/prefect/server/models/artifacts.py:341:35-42: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect | Select[Unknown]) [no-matching-overload]
+ ERROR src/prefect/server/models/artifacts.py:434:9-436:16: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/models/artifacts.py:443:9-445:16: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/models/artifacts.py:497:34-503:14: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect) [no-matching-overload]
- ERROR src/prefect/server/models/artifacts.py:534:12-27: Object of class `Result` has no attribute `rowcount` [missing-attribute]
+ ERROR src/prefect/server/models/artifacts.py:508:17-510:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/models/artifacts.py:525:34-529:14: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/models/artifacts.py:533:35-48: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/models/block_documents.py:386:9-38: Object of class `GenerativeSelect` has no attribute `execution_options` [missing-attribute]
+ ERROR src/prefect/server/models/block_documents.py:472:35-42: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
- ERROR src/prefect/server/models/block_documents.py:473:12-27: Object of class `Result` has no attribute `rowcount` [missing-attribute]
+ ERROR src/prefect/server/models/block_documents.py:580:17-582:24: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
+ ERROR src/prefect/server/models/block_documents.py:663:35-42: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
+ ERROR src/prefect/server/models/block_schemas.py:117:23-56: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
- ERROR src/prefect/server/models/block_documents.py:664:12-27: Object of class `Result` has no attribute `rowcount` [missing-attribute]
+ ERROR src/prefect/server/models/block_schemas.py:124:9-130:27: Object of class `GenerativeSelect` has no attribute `execution_options` [missing-attribute]
+ ERROR src/prefect/server/models/block_schemas.py:300:35-302:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
- ERROR src/prefect/server/models/block_schemas.py:303:12-27: Object of class `Result` has no attribute `rowcount` [missing-attribute]
+ ERROR src/prefect/server/models/block_schemas.py:618:40-74: Object of class `GenerativeSelect` has no attribute `where` [missing-attribute]
+ ERROR src/prefect/server/models/block_schemas.py:628:31-61: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect | Unknown) [no-matching-overload]
+ ERROR src/prefect/server/models/block_schemas.py:655:9-665:14: Object of class `GenerativeSelect` has no attribute `join` [missing-attribute]
+ ERROR src/prefect/server/models/block_schemas.py:737:35-68: Object of class `GenerativeSelect` has no attribute `filter_by` [missing-attribute]
+ ERROR src/prefect/server/models/block_types.py:60:23-56: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR src/prefect/server/models/block_types.py:140:17-28: Object of class `GenerativeSelect` has no attribute `where` [missing-attribute]
+ ERROR src/prefect/server/models/block_types.py:147:17-28: Object of class `GenerativeSelect` has no attribute `where` [missing-attribute]
+ ERROR src/prefect/server/models/block_types.py:155:35-42: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (GenerativeSelect | Unknown) [no-matching-overload]
+ ERROR src/prefect/server/models/block_types.py:195:9-197:16: Object of class `DMLWhereBase` has no attribute `values` [missing-attribute]
- ERROR src/prefect/server/models/block_types.py:221:12-27: Object of class `Result` has no attribute `rowcount` [missing-attribute]
+ ERROR src/prefect/server/models/block_types.py:218:35-220:6: No matching overload found for function `sqlalchemy.ext.asyncio.session.AsyncSession.execute` called with arguments: (DMLWhereBase) [no-matching-overload]
- ERROR src/prefect/server/models/concurrency_limits.py:153:12-27: Object of class `Result` has no attribute `rowcount` [missing-attribute]

... (truncated 158 lines) ...

static-frame (https://github.com/static-frame/static-frame)
+ ERROR static_frame/core/frame.py:779:16-787:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:1203:16-1213:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:1245:16-1251:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:1384:16-1393:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:1880:20-1888:14: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:1905:20-1913:14: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2081:20-2092:14: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2134:16-2142:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2180:16-2188:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2218:16-2227:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2259:16-2267:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2300:16-2309:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2339:16-2348:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2732:16-2759:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2798:16-2825:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:2873:16-2900:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:3445:16-3456:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:8383:16-8390:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/frame.py:8460:16-8466:10: Returned type `Frame[TVIndex, TVColumns, TVDtypes]` is not assignable to declared return type `Self@Frame` [bad-return]
+ ERROR static_frame/core/series.py:518:16-20: Returned type `Series[TVIndex, TVDtype] | Self@Series` is not assignable to declared return type `Self@Series` [bad-return]
+ ERROR static_frame/core/series.py:2786:16-2790:10: Returned type `Series` is not assignable to declared return type `Self@Series` [bad-return]
+ ERROR static_frame/core/yarn.py:724:16-59: Returned type `Yarn[TVIndex]` is not assignable to declared return type `Self@Yarn` [bad-return]
+ ERROR static_frame/test/typing/test_frame.py:27:22-59: `Frame[Any, Any, *tuple[()]]` is not assignable to `FrameGO` [bad-assignment]
+ ERROR static_frame/test/typing/test_frame.py:35:22-60: `Frame[Any, Any, *tuple[()]]` is not assignable to `FrameGO` [bad-assignment]
+ ERROR static_frame/test/typing/test_frame.py:42:22-63: `Frame[Any, Any, *tuple[()]]` is not assignable to `FrameGO` [bad-assignment]
+ ERROR static_frame/test/typing/test_frame.py:65:23-55: `Frame[Any, Any, *tuple[()]]` is not assignable to `FrameGO` [bad-assignment]
+ ERROR static_frame/test/typing/test_frame.py:79:23-55: `Frame` is not assignable to `FrameHE` [bad-assignment]
+ ERROR static_frame/test/typing/test_frame.py:145:23-55: `Frame[Any, Any, *tuple[()]]` is not assignable to `FrameGO` [bad-assignment]
+ ERROR static_frame/test/typing/test_frame.py:156:23-55: `Frame` is not assignable to `FrameHE` [bad-assignment]
- ERROR static_frame/test/unit/test_frame.py:2385:25-40: Argument `_odict_items[str, ndarray]` is not assignable to parameter `pairs` with type `Iterable[tuple[TLabel, Series]]` in function `static_frame.core.frame.FrameGO.extend_items` [bad-argument-type]
- ERROR static_frame/test/unit/test_frame.py:2467:23-26: Argument `Literal['a']` is not assignable to parameter `container` with type `Frame | Series` in function `static_frame.core.frame.FrameGO.extend` [bad-argument-type]
+ ERROR static_frame/test/unit/test_frame.py:2385:9-24: Object of class `Frame` has no attribute `extend_items` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2405:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2435:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2446:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2457:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2467:13-22: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2484:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2515:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2541:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2574:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2587:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2609:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2624:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]
+ ERROR static_frame/test/unit/test_frame.py:2667:9-18: Object of class `Frame` has no attribute `extend` [missing-attribute]

mypy (https://github.com/python/mypy)
- ERROR mypy/typeshed/stdlib/builtins.pyi:227:5-17: Argument `(metacls: Self@type, name: str, bases: tuple[type[Any], ...], /, **kwds: Any) -> MutableMapping[str, object]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:227:5-17: Argument `(metacls: type, name: str, bases: tuple[type[Any], ...], /, **kwds: Any) -> MutableMapping[str, object]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:277:9-21: Argument `(cls: Self@int, bytes: Buffer | Iterable[SupportsIndex] | SupportsBytes, byteorder: Literal['big', 'little'] = 'big', *, signed: bool = False) -> Self@int` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:277:9-21: Argument `(cls: int, bytes: Buffer | Iterable[SupportsIndex] | SupportsBytes, byteorder: Literal['big', 'little'] = 'big', *, signed: bool = False) -> int` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:370:5-17: Argument `(cls: Self@float, string: str, /) -> Self@float` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:370:5-17: Argument `(cls: float, string: str, /) -> float` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:640:9-21: Argument `(cls: Self@bytes, string: str, /) -> Self@bytes` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:640:9-21: Argument `(cls: bytes, string: str, /) -> bytes` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:750:9-21: Argument `(cls: Self@bytearray, string: str, /) -> Self@bytearray` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:750:9-21: Argument `(cls: bytearray, string: str, /) -> bytearray` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:1117:5-17: Argument `(cls: Self@mypy.typeshed.stdlib.builtins.dict, iterable: Iterable[_T], value: None = None, /) -> builtins.dict[_T, Any | None]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:1117:5-17: Argument `(cls: mypy.typeshed.stdlib.builtins.dict[_KT, _VT], iterable: Iterable[_T], value: None = None, /) -> builtins.dict[_T, Any | None]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:1120:5-17: Argument `(cls: Self@mypy.typeshed.stdlib.builtins.dict, iterable: Iterable[_T], value: _S, /) -> builtins.dict[_T, _S]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:1120:5-17: Argument `(cls: mypy.typeshed.stdlib.builtins.dict[_KT, _VT], iterable: Iterable[_T], value: _S, /) -> builtins.dict[_T, _S]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]

optuna (https://github.com/optuna/optuna)
+ ERROR optuna/samplers/_brute_force.py:68:9-73:56: Pyrefly detected conflicting types while breaking a dependency cycle: `_TreeNode | Self@_TreeNode` is not assignable to `Self@_TreeNode`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR optuna/storages/_rdb/alembic/versions/v1.3.0.a.py:68:13-70:31: Object of class `DMLWhereBase` has no attribute `execution_options` [missing-attribute]
+ ERROR optuna/storages/_rdb/storage.py:776:33-74: Object of class `ValuesBase` has no attribute `on_duplicate_key_update` [missing-attribute]
+ ERROR optuna/storages/_rdb/storage.py:777:28-54: Object of class `ValuesBase` has no attribute `inserted` [missing-attribute]
+ ERROR optuna/storages/_rdb/storage.py:784:34-74: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR optuna/storages/_rdb/storage.py:786:38-65: Object of class `ValuesBase` has no attribute `excluded` [missing-attribute]
+ ERROR optuna/storages/_rdb/storage.py:793:30-66: Object of class `ValuesBase` has no attribute `on_conflict_do_update` [missing-attribute]
+ ERROR optuna/storages/_rdb/storage.py:795:38-61: Object of class `ValuesBase` has no attribute `excluded` [missing-attribute]

jax (https://github.com/google/jax)
+ ERROR jax/experimental/mosaic/gpu/fragmented_array.py:314:5-315:58: Pyrefly detected conflicting types while breaking a dependency cycle: `TiledLayoutImpl | Self@TiledLayoutImpl` is not assignable to `Self@TiledLayoutImpl`. Adding explicit type annotations might possibly help. [bad-assignment]

pip (https://github.com/pypa/pip)
+ ERROR src/pip/_vendor/rich/segment.py:430:33-72: Argument `list[list[Self@Segment]]` is not assignable to parameter `iterable` with type `Iterable[list[Segment]]` in function `list.extend` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:218:36-41: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:239:36-41: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:478:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:630:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:653:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:676:37-42: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]
+ ERROR src/pip/_vendor/rich/style.py:734:41-46: Argument `type[Style]` is not assignable to parameter `cls` with type `type[Self@Style]` in function `object.__new__` [bad-argument-type]

pycryptodome (https://github.com/Legrandin/pycryptodome)
+ ERROR lib/Crypto/Hash/CMAC.py:173:28-32: Argument `type[CMAC]` is not assignable to parameter `cls` with type `type[Self@CMAC]` in function `object.__new__` [bad-argument-type]

sphinx (https://github.com/sphinx-doc/sphinx)
+ ERROR sphinx/domains/c/_symbol.py:246:9-248:25: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/c/_symbol.py:259:9-261:25: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/c/_symbol.py:294:13-295:53: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/c/_symbol.py:663:9-675:22: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/cpp/_symbol.py:336:9-338:25: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/cpp/_symbol.py:352:9-354:25: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/cpp/_symbol.py:558:13-559:53: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR sphinx/domains/cpp/_symbol.py:1073:9-1106:28: Pyrefly detected conflicting types while breaking a dependency cycle: `Symbol | Self@Symbol` is not assignable to `Self@Symbol`. Adding explicit type annotations might possibly help. [bad-assignment]

meson (https://github.com/mesonbuild/meson)
- ERROR mesonbuild/interpreter/interpreter.py:325:26-384:30: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, (self: Self@Interpreter, node: BaseNode, args: TYPE_var, kwargs: dict[str, HoldableObject | MesonInterpreterObject | Sequence[TYPE_elementary] | Sequence[TYPE_var] | bool | dict[str, TYPE_elementary] | dict[str, TYPE_var] | int | str]) -> NoReturn | (self: Self@Interpreter, node: BaseNode, args: Unknown, kwargs: Unknown) -> None | (self: Self@Interpreter, node: Unknown, args: Unknown, kwargs: Unknown) -> Disabler | (self: Self@Interpreter, node: Unknown, args: Unknown, kwargs: Unknown) -> Never | (self: Self@Interpreter, node: Unknown, args: Unknown, kwargs: Unknown) -> None | (self: Self@Interpreter, nodes: Unknown, args: Unknown, kwargs: Unknown) -> Never | Any]) [no-matching-overload]
+ ERROR mesonbuild/interpreter/interpreter.py:325:26-384:30: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, (self: Interpreter, node: BaseNode, args: TYPE_var, kwargs: dict[str, HoldableObject | MesonInterpreterObject | Sequence[TYPE_elementary] | Sequence[TYPE_var] | bool | dict[str, TYPE_elementary] | dict[str, TYPE_var] | int | str]) -> NoReturn | (self: Interpreter, node: BaseNode, args: Unknown, kwargs: Unknown) -> None | (self: Interpreter, node: Unknown, args: Unknown, kwargs: Unknown) -> Disabler | (self: Interpreter, node: Unknown, args: Unknown, kwargs: Unknown) -> Never | (self: Interpreter, node: Unknown, args: Unknown, kwargs: Unknown) -> None | (self: Self@Interpreter, nodes: Unknown, args: Unknown, kwargs: Unknown) -> Never | Any]) [no-matching-overload]
- ERROR mesonbuild/interpreter/interpreter.py:3192:9-32: Overload return type `list[File]` is not assignable to implementation return type `list[SourceOutputs]` [inconsistent-overload]
- ERROR mesonbuild/interpreter/interpreter.py:3195:9-32: Overload return type `list[FileOrString]` is not assignable to implementation return type `list[SourceOutputs]` [inconsistent-overload]
- ERROR mesonbuild/interpreter/interpreter.py:3198:9-32: Overload return type `list[CustomTarget | CustomTargetIndex | File | GeneratedList]` is not assignable to implementation return type `list[SourceOutputs]` [inconsistent-overload]
- ERROR mesonbuild/modules/cmake.py:193:28-202:10: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, (self: Self@CMakeSubprojectOptions, state: ModuleState, args: TYPE_var, kwargs: dict[str, HoldableObject | MesonInterpreterObject | Sequence[TYPE_elementary] | Sequence[TYPE_var] | bool | dict[str, TYPE_elementary] | dict[str, TYPE_var] | int | str]) -> None | Any]) [no-matching-overload]
+ ERROR mesonbuild/modules/cmake.py:193:28-202:10: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, (self: CMakeSubprojectOptions, state: ModuleState, args: TYPE_var, kwargs: dict[str, HoldableObject | MesonInterpreterObject | Sequence[TYPE_elementary] | Sequence[TYPE_var] | bool | dict[str, TYPE_elementary] | dict[str, TYPE_var] | int | str]) -> None | Any]) [no-matching-overload]
- ERROR mesonbuild/modules/modtest.py:22:28-24:11: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, (self: Self@TestModule, state: ModuleState, args: list[TYPE_var], kwargs: dict[str, HoldableObject | MesonInterpreterObject | Sequence[TYPE_elementary] | Sequence[TYPE_var] | bool | dict[str, TYPE_elementary] | dict[str, TYPE_var] | int | str]) -> None]) [no-matching-overload]
+ ERROR mesonbuild/modules/modtest.py:22:28-24:11: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, (self: TestModule, state: ModuleState, args: list[TYPE_var], kwargs: dict[str, HoldableObject | MesonInterpreterObject | Sequence[TYPE_elementary] | Sequence[TYPE_var] | bool | dict[str, TYPE_elementary] | dict[str, TYPE_var] | int | str]) -> None]) [no-matching-overload]
+ ERROR mesonbuild/mtest.py:965:32-72: Argument `type[TestRun]` is not assignable to parameter `cls` with type `type[Self@TestRun]` in function `object.__new__` [bad-argument-type]

CPython (cases_generator) (https://github.com/python/cpython)
- ERROR Tools/cases_generator/parsing.py:333:5-16: Argument `(self: Self@Parser) -> Family | InstDef | LabelDef | Macro | Pseudo | None` is not assignable to parameter `func` with type `(Self@Parser) -> Family | None` in function `contextual` [bad-argument-type]
+ ERROR Tools/cases_generator/parsing.py:333:5-16: Argument `(self: Parser) -> Family | InstDef | LabelDef | Macro | Pseudo | None` is not assignable to parameter `func` with type `(Parser) -> Family | None` in function `contextual` [bad-argument-type]
- ERROR Tools/cases_generator/parsing.py:429:5-16: Argument `(self: Self@Parser) -> CacheEffect | StackEffect | None` is not assignable to parameter `func` with type `(Self@Parser) -> CacheEffect | None` in function `contextual` [bad-argument-type]
+ ERROR Tools/cases_generator/parsing.py:429:5-16: Argument `(self: Parser) -> CacheEffect | StackEffect | None` is not assignable to parameter `func` with type `(Parser) -> CacheEffect | None` in function `contextual` [bad-argument-type]
- ERROR Tools/cases_generator/parsing.py:535:5-16: Argument `(self: Self@Parser) -> CacheEffect | OpName | None` is not assignable to parameter `func` with type `(Self@Parser) -> CacheEffect | None` in function `contextual` [bad-argument-type]
+ ERROR Tools/cases_generator/parsing.py:535:5-16: Argument `(self: Parser) -> CacheEffect | OpName | None` is not assignable to parameter `func` with type `(Parser) -> CacheEffect | None` in function `contextual` [bad-argument-type]

python-chess (https://github.com/niklasf/python-chess)
+ ERROR chess/__init__.py:1568:16-21: Returned type `BaseBoard` is not assignable to declared return type `Self@BaseBoard` [bad-return]
+ ERROR chess/__init__.py:1852:20-25: Returned type `Board` is not assignable to declared return type `Self@Board` [bad-return]
+ ERROR chess/__init__.py:3062:59-103: Argument `() -> Board` is not assignable to parameter `make_board` with type `() -> Self@Board` in function `Board._parse_epd_ops` [bad-argument-type]
+ ERROR chess/__init__.py:4220:9-4221:26: Pyrefly detected conflicting types while breaking a dependency cycle: `SquareSet | Self@SquareSet` is not assignable to `Self@SquareSet`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR chess/__init__.py:4228:9-4229:26: Pyrefly detected conflicting types while breaking a dependency cycle: `SquareSet | Self@SquareSet` is not assignable to `Self@SquareSet`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR chess/pgn.py:270:9-271:31: Pyrefly detected conflicting types while breaking a dependency cycle: `GameNode | Self@GameNode` is not assignable to `Self@GameNode`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR chess/pgn.py:292:9-293:38: Pyrefly detected conflicting types while breaking a dependency cycle: `ChildNode | Self@GameNode` is not assignable to `Self@GameNode`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR chess/pgn.py:329:9-335:26: Pyrefly detected conflicting types while breaking a dependency cycle: `GameNode | Self@GameNode` is not assignable to `Self@GameNode`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR chess/pgn.py:442:9-444:34: Pyrefly detected conflicting types while breaking a dependency cycle: `ChildNode | Self@GameNode` is not assignable to `Self@GameNode`. Adding explicit type annotations might possibly help. [bad-assignment]
+ ERROR chess/pgn.py:1050:16-32: Returned type `Headers` is not assignable to declared return type `Self@Headers` [bad-return]
+ ERROR chess/variant.py:732:59-103: Argument `() -> ThreeCheckBoard` is not assignable to parameter `make_board` with type `() -> Self@ThreeCheckBoard` in function `chess.Board._parse_epd_ops` [bad-argument-type]
+ ERROR chess/variant.py:868:16-22: Returned type `CrazyhousePocket` is not assignable to declared return type `Self@CrazyhousePocket` [bad-return]

scrapy (https://github.com/scrapy/scrapy)
- ERROR tests/test_utils_defer.py:146:5-28: Argument `(self: Self@TestAsyncDefTestsuite) -> AsyncGenerator[None, Unknown]` is not assignable to parameter `coro_f` with type `(self: Self@TestAsyncDefTestsuite) -> Awaitable[@_]` in function `scrapy.utils.defer.deferred_f_from_coro_f` [bad-argument-type]
+ ERROR tests/test_utils_defer.py:146:5-28: Argument `(self: TestAsyncDefTestsuite) -> AsyncGenerator[None, Unknown]` is not assignable to parameter `coro_f` with type `(self: TestAsyncDefTestsuite) -> Awaitable[@_]` in function `scrapy.utils.defer.deferred_f_from_coro_f` [bad-argument-type]

psycopg (https://github.com/psycopg/psycopg)
+ ERROR psycopg/psycopg/pq/pq_ctypes.py:107:35-39: Argument `Self@psycopg.psycopg.pq.pq_ctypes.PGconn` is not assignable to parameter `pgconn` with type `psycopg.psycopg.pq.abc.PGconn` in function `psycopg.psycopg.pq.misc.connection_summary` [bad-argument-type]

egglog-python (https://github.com/egraphs-good/egglog-python)
+ ERROR python/egglog/declarations.py:748:26-41: Argument `list[TypedExprDecl]` is not assignable to parameter `iterable` with type `Iterable[Self@TypedExprDecl]` in function `list.extend` [bad-argument-type]
+ ERROR python/egglog/declarations.py:749:16-17: Returned type `list[Self@TypedExprDecl]` is not assignable to declared return type `list[TypedExprDecl]` [bad-return]
- ERROR python/egglog/egraph.py:1004:9-16: Overload signature `(self: Self@EGraph, expr: BASE_EXPR, /, include_cost: Literal[True], cost_model: None = None) -> tuple[BASE_EXPR, int]` is not consistent with implementation signature `(self: Self@EGraph, expr: BASE_EXPR, /, include_cost: bool = False, cost_model: CostModel[COST] | None = None) -> tuple[BASE_EXPR, COST] | BASE_EXPR` [inconsistent-overload]

altair (https://github.com/vega/altair)
+ ERROR altair/vegalite/v6/api.py:1203:16-83: Returned type `Then[@_]` is not assignable to declared return type `Self@Then` [bad-return]
+ ERROR tests/altair_theme_test.py:47:9-49:16: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/altair_theme_test.py:55:9-57:16: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/altair_theme_test.py:65:9-69:16: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/altair_theme_test.py:78:9-80:26: Object of class `MarkMethodMixin` has no attribute `transform_filter` [missing-attribute]
+ ERROR tests/altair_theme_test.py:95:9-97:16: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/altair_theme_test.py:104:9-106:16: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/altair_theme_test.py:118:9-125:16: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/airport_connections.py:28:14-31:13: Object of class `MarkMethodMixin` has no attribute `properties` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/airport_connections.py:36:15-72: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/airport_connections.py:52:10-57: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/annual_weather_heatmap.py:11:1-88: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/anscombe_plot.py:20:1-39: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/area_chart_gradient.py:14:1-27:9: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/area_faceted.py:14:1-16:21: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_and_line_with_dual_axis.py:16:7-29: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_and_line_with_dual_axis.py:18:9-43: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_faceted_compact.py:43:1-66: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_horizontal.py:12:1-36: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_sorted.py:12:1-36: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_highlighted_bar.py:17:1-36: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py:14:8-43: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py:19:13-63: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_highlighted_segment.py:27:8-47: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_labels.py:18:1-53: `+` is not supported between `MarkMethodMixin` and `MarkMethodMixin` [unsupported-operation]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_labels_measured_luminance.py:18:8-20:9: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_mean_line.py:12:7-42: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_mean_line.py:17:8-55: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_negatives.py:15:1-36: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_range.py:12:7-68: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_range.py:18:12-68: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_range.py:24:12-66: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_single_threshold.py:16:8-60: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_chart_with_single_threshold.py:27:8-38: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_faceted_stacked.py:14:1-36: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_rounded.py:12:1-15:9: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_with_rolling_mean.py:12:7-42: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bar_with_rolling_mean.py:17:8-65: Object of class `MarkMethodMixin` has no attribute `transform_window` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/beckers_barley_facet.py:18:1-66: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/beckers_barley_wrapped_facet.py:18:1-38: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/boxplot.py:15:1-56: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bubble_plot.py:12:1-38: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/bump_chart.py:17:1-49: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/calculate_residuals.py:18:5-20:22: Object of class `MarkMethodMixin` has no attribute `transform_filter` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/candlestick_chart.py:32:8-31: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/candlestick_chart.py:41:7-29: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/choropleth.py:13:1-43: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/choropleth_repeat.py:14:1-41: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/co2_concentration.py:43:8-31: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/comet_chart.py:15:5-20:12: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/cumulative_count_chart.py:15:1-18:21: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/dendrogram.py:102:12-35: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/dendrogram.py:107:8-31: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/dendrogram.py:112:8-31: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/dendrogram.py:122:14-126:9: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/density_repeat.py:16:1-26:21: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/density_stack.py:18:1-24:21: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/deviation_ellipses.py:75:10-69: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/deviation_ellipses.py:80:9-74: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]
+ ERROR tests/examples_arguments_syntax/distributions_and_medians_of_likert_scale_ratings.py:241:5-248:12: Object of class `MarkMethodMixin` has no attribute `encode` [missing-attribute]

... (truncated 136 lines) ...```

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Primer Diff Classification

❌ 15 regression(s) | ✅ 24 improvement(s) | ➖ 4 neutral | 43 project(s) total

15 regression(s) across trio, hydpy, mongo-python-driver, operator, dd-trace-py, asynq, discord.py, parso, isort, optuna, jax, meson, scrapy, altair, artigraph. error kinds: bad-assignment, bad-argument-type, no-matching-overload. caused by is_subset_eq(), self_type_to_class_type(). 24 improvement(s) across urllib3, black, Expression, archinstall, ppb-vector, core, pyodide, pandera, rich, pydantic, jinja, streamlit, dedupe, strawberry, hydra-zen, prefect, static-frame, mypy, pip, pycryptodome, sphinx, python-chess, psycopg, egglog-python.

Project Verdict Changes Error Kinds Root Cause
urllib3 ✅ Improvement +2 bad-return The change to subset.rs removed the subtyping rule that...
trio ❌ Regression +4, -1 bad-argument-type, bad-specialization self_type_to_class_type()
black ✅ Improvement +1 bad-assignment pyrefly/lib/solver/subset.rs
Expression ✅ Improvement +2, -6 bad-argument-type, inconsistent-overload pyrefly/lib/solver/subset.rs
hydpy ❌ Regression +10, -1 bad-return Self violations pyrefly/lib/solver/subset.rs
archinstall ✅ Improvement +8 bad-return, unsupported-operation The changes to subset.rs removed the subtyping rules th...
ppb-vector ✅ Improvement -2 inconsistent-overload bind_dunder_init_for_callable()
core ✅ Improvement +38, -4 bad-return on Self violations self_type_to_class_type()
tornado ➖ Neutral +3, -3 no-matching-overload
mongo-python-driver ❌ Regression +1 bad-argument-type pyrefly/lib/solver/subset.rs
pyodide ✅ Improvement +1, -2 bad-argument-type, inconsistent-overload check_overloaded_function()
pandera ✅ Improvement +1, -2 bad-override, redundant-cast pyrefly/lib/solver/subset.rs
operator ❌ Regression +1 bad-assignment self_type_to_class_type()
rich ✅ Improvement +8 bad-argument-type pyrefly/lib/solver/subset.rs
dd-trace-py ❌ Regression +1 bad-assignment is_subset_eq()
asynq ❌ Regression +12, -22 bad-argument-type, bad-override self_type_to_class_type()
mkdocs ➖ Neutral +1, -1 bad-assignment
discord.py ❌ Regression +1 no-matching-overload pyrefly/lib/solver/subset.rs
pydantic ✅ Improvement +6 bad-return self_type_to_class_type()
jinja ✅ Improvement +3 bad-argument-type pyrefly/lib/solver/subset.rs
mitmproxy ➖ Neutral +1, -1 no-matching-overload
streamlit ✅ Improvement -1 inconsistent-overload check_overloads()
dedupe ✅ Improvement -10 inconsistent-overload check_overloads()
bokeh ➖ Neutral +1, -1 bad-argument-type
parso ❌ Regression +1 bad-assignment pyrefly/lib/solver/subset.rs
strawberry ✅ Improvement +2 bad-return self_type_to_class_type()
isort ❌ Regression +1 no-matching-overload pyrefly/lib/solver/subset.rs
hydra-zen ✅ Improvement +1 bad-return pyrefly/lib/solver/subset.rs
prefect ✅ Improvement +221, -54 bad-argument-type, bad-return self_type_to_class_type()
static-frame ✅ Improvement +43, -2 bad-return self_type_to_class_type()
mypy ✅ Improvement +7, -7 bad-argument-type self_type_to_class_type()
optuna ❌ Regression +8 bad-assignment, missing-attribute pyrefly/lib/solver/subset.rs
jax ❌ Regression +1 bad-assignment pyrefly/lib/solver/subset.rs
pip ✅ Improvement +8 bad-argument-type pyrefly/lib/solver/subset.rs
pycryptodome ✅ Improvement +1 bad-argument-type pyrefly/lib/solver/subset.rs
sphinx ✅ Improvement +8 bad-assignment pyrefly/lib/solver/subset.rs
meson ❌ Regression +4, -6 bad-argument-type, inconsistent-overload self_type_to_class_type()
python-chess ✅ Improvement +12 bad-argument-type, bad-assignment pyrefly/lib/solver/subset.rs
scrapy ❌ Regression +1, -1 bad-argument-type pyrefly/lib/solver/subset.rs
psycopg ✅ Improvement +1 bad-argument-type pyrefly/lib/solver/subset.rs
egglog-python ✅ Improvement +2, -1 bad-return errors pyrefly/lib/solver/subset.rs
altair ❌ Regression +653, -5 missing-attribute on MarkMethodMixin self_type_to_class_type()
artigraph ❌ Regression +30, -1 bad-assignment, bad-return self_type_to_class_type()
Detailed analysis

❌ Regression (15)

trio (+4, -1)

This is a REGRESSION. The PR intentionally removes the ClassType <: SelfType subtyping rule to improve spec compliance, but this creates false positive errors in trio. The new errors flag legitimate code patterns where concrete classes are used in Self-typed contexts. While the spec may not explicitly require ClassType <: SelfType subtyping, the established ecosystem behavior (mypy/pyright) is more permissive. The trio code is correct - set[CancelStatus] should be compatible with Iterable[Self@CancelStatus] when Self resolves to CancelStatus. These are theoretical type system strictness improvements that create practical false positives in real codebases.
Attribution: The changes in pyrefly/lib/solver/subset.rs removed the (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) subtyping rules. Additionally, multiple files added .[self_type_to_class_type()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/solver/subset.rs) calls to convert Self types to concrete class types in various contexts like overload checking, constructor handling, and decorator processing.

hydpy (+10, -1)

bad-return Self violations: These correctly identify that methods should return Self when annotated as such, not concrete class instances
removed overload consistency check: This was a legitimate type safety check that should not have been removed

Overall: The new errors correctly identify violations of Self type semantics per the typing spec. Methods annotated with -> Self should return Self, not concrete class instances, even when they're the same class. Line 99 returns type(self)(bools) which creates a CustomMask instance, but the annotation requires Self@CustomMask. Lines 163 and 166 have similar issues with type(self)(obj) and type(self)(self.variable, **kwargs). The removed overload error was catching a legitimate type safety issue where the implementation return type Add | Multiply was narrower than the overload return type Add | Multiply | MultiplyIUH | Replace | ReplaceIUH.

Attribution: The change to remove the ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs caused the new bad-return errors to appear. Previously, concrete class types were considered subtypes of Self types, so returning CustomMask when Self@CustomMask was expected was allowed. The removal of overload return type checking for methods in pyrefly/lib/alt/function.rs caused the inconsistent-overload error to disappear.

mongo-python-driver (+1)

This is a REGRESSION. While there may be a theoretical type system argument for stricter Self-type checking, this flags an extremely common and correct Python pattern: calling super().new(cls) in a new method. The SON class correctly inherits from Dict and properly calls the parent constructor. Mypy and pyright would not flag this pattern because it's fundamental to Python's object construction model. The error creates false positive noise on correct, idiomatic code that works perfectly at runtime. The PR is making pyrefly stricter than the ecosystem standard for Self-type compatibility.
Attribution: The removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs (lines removing the (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) cases) caused this error. This change makes pyrefly stricter about Self-type compatibility.

operator (+1)

This is a type inference failure indicated by the Never type in CallableProxyType[Never]. The error claims that CallableProxyType[Never] cannot be assigned to Framework, but this suggests pyrefly failed to properly infer the type of weakref.proxy(self.framework). Looking at line 391, self.framework is of type Framework, so weakref.proxy(self.framework) should be CallableProxyType[Framework], not CallableProxyType[Never]. The appearance of Never indicates the type checker lost track of the actual type during inference. The PR changes to SelfType handling appear to have disrupted type inference in this context, causing pyrefly to incorrectly infer Never where it should infer Framework. This is a regression - the code is correct but pyrefly's type inference got worse.
Attribution: The change to self_type_to_class_type() method in pyrefly/lib/alt/function.rs and related changes in pyrefly/lib/alt/call.rs modified how SelfType is handled in callable contexts. The new logic converts SelfType to ClassType in various scenarios, which appears to have caused type inference to fail and produce Never types in this context.

dd-trace-py (+1)

This is a REGRESSION. The removed subtyping rule ClassType <: SelfType was handling a legitimate and common pattern where methods within a class assign concrete instances of that class to Self-typed variables. The code is correct - within the LoggerPrefix.lookup() method, assigning a LoggerPrefix instance to a Self@LoggerPrefix variable is safe and expected. The typing spec doesn't require this strict separation, and other type checkers (mypy/pyright) would not flag this pattern. Removing this subtyping rule creates false positive noise for common, safe code patterns.
Attribution: The change to is_subset_eq() in pyrefly/lib/solver/subset.rs removed the subtyping rule (Type::ClassType(got), Type::SelfType(want)) that previously allowed LoggerPrefix to be assignable to Self@LoggerPrefix. This removal makes pyrefly stricter about Self type assignments.

asynq (+12, -22)

This is a regression. The PR removes the ClassType <: SelfType subtyping rule, which causes pyrefly to become more strict about Self type checking than the established ecosystem standard. The new errors appear in the same locations as the removed errors, indicating this is a change in type inference behavior rather than catching new bugs. The asynq library code is using standard Python decorator patterns that work correctly at runtime. The error messages show complex generic type mismatches that are likely artifacts of pyrefly's internal type representation changes rather than genuine type issues. Mypy and pyright would not flag these patterns because they handle Self types more leniently in decorator contexts. The bad-override error in test code also appears to be a cascade effect from the stricter Self type checking.
Attribution: The change to self_type_to_class_type() in pyrefly/lib/alt/function.rs and the removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs caused these errors. The PR removes the subtyping relationship that allowed ClassType to be considered a subtype of SelfType, which affects how method decorators are type-checked.

discord.py (+1)

This is a regression. The PR removes a subtyping rule that allowed concrete class types to be compatible with SelfType in overload resolution. While the PR correctly tightens return type checking (as shown in conformance tests), it creates false positives in descriptor protocol usage. The CachedSlotProperty.__get__ method is designed to work with both concrete instances and Self types, but pyrefly can no longer resolve the overloads. This is stricter than the established ecosystem behavior - mypy/pyright would not flag this pattern.
Attribution: The removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs (lines removing (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) cases) caused this overload resolution to fail where it previously succeeded.

parso (+1)

This is a regression. The code is correct - BaseNode is a subclass of NodeOrLeaf, so assigning scope.parent (BaseNode) to scope (Self@NodeOrLeaf) should be valid. The PR removed the ClassType <: SelfType subtyping rule, which was actually correct behavior. Mypy/pyright would not flag this pattern because they understand inheritance relationships with Self types. The removed subtyping rule properly handled cases where concrete subclasses are assigned to Self-typed variables.
Attribution: The removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs (specifically the removed cases handling (Type::ClassType(got), Type::SelfType(want))) caused this error. This removed a valid subtyping relationship.

isort (+1)

This is a regression. The error flags valid Python code that works correctly at runtime. The super().__new__(cls, value) pattern in _LineWithComments.__new__ is a standard way to create instances of str subclasses. The PR intentionally removed the ClassType <: SelfType subtyping rule, but this creates false positive errors for legitimate constructor patterns. While the PR may be pursuing spec compliance, it's making pyrefly stricter than the established ecosystem standard where mypy/pyright would not flag this pattern.
Attribution: The removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs (specifically the removed cases for (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want))) caused this overload resolution to fail. The type checker can no longer match type[_LineWithComments] against SelfType parameters in str.new.

optuna (+8)

This is a REGRESSION. While the PR correctly implements stricter Self type semantics per the typing spec, it breaks type resolution for legitimate SQLAlchemy code patterns. The missing-attribute errors on well-established SQLAlchemy methods like on_duplicate_key_update and execution_options are false positives - these methods exist and are widely used. The @_ type in the bad-assignment error indicates a type inference failure during dependency cycle resolution. The removed subtyping rule was helping the type checker resolve these patterns correctly, and removing it created false positive noise without catching real bugs.
Attribution: The removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs caused these errors. The missing-attribute errors likely arise because SQLAlchemy's type stubs use Self types that no longer accept ClassType assignments, breaking method resolution. The bad-assignment error with @_ types indicates the dependency cycle resolution is now failing where it previously succeeded.

jax (+1)

This is a REGRESSION. The PR intentionally removed the ClassType <: SelfType subtyping rule to improve spec compliance, but this creates a false positive. The code is correct - the method returns the same type as self after transformations. The error occurs because pyrefly now requires explicit Self types where the old rule allowed concrete classes to satisfy Self constraints. While the new behavior may be more spec-compliant, it flags working code that other type checkers accept.
Attribution: The removal of the (Type::ClassType(got), Type::SelfType(want)) subtyping rule in pyrefly/lib/solver/subset.rs caused this error by making concrete class types no longer assignable to Self types.

meson (+4, -6)

This appears to be a regression. The PR removes a subtyping rule and introduces more restrictive type checking that produces false positives. The new errors involve complex callable signatures with Never types (indicating inference failures) and overly strict Self type checking. The removed errors were likely false positives that the change correctly eliminated, but the new errors suggest the implementation is now too restrictive. The meson build system is a well-tested project, and these patterns work correctly at runtime - pyrefly should not be flagging them as type errors.
Attribution: The change to remove the ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs and the addition of self_type_to_class_type() conversions in various files like pyrefly/lib/alt/call.rs and pyrefly/lib/alt/function.rs caused these changes. The new approach converts SelfType to ClassType in specific contexts rather than allowing general subtyping.

scrapy (+1, -1)

This is a type inference failure, not a real bug. The error claims that AsyncGenerator[None, Unknown] is not assignable to Awaitable[@_], but both Unknown and @_ are inference failure markers. The method test_deferred_f_from_coro_f_generator on line 147 is an async generator function that yields None, which should be compatible with the decorator's expectations. The presence of @_ in the expected type signature strongly indicates that pyrefly failed to properly infer the type rather than catching a genuine type error. The change from the old error to the new error only affects the display of Self@TestAsyncDefTestsuite vs TestAsyncDefTestsuite but doesn't resolve the underlying inference problem. This represents a regression in type inference quality.
Attribution: The change to remove the ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs (removing the case that allowed Type::ClassType(got) to be a subtype of Type::SelfType(want)) caused this change. The error message format changed from showing Self@TestAsyncDefTestsuite to TestAsyncDefTestsuite, but the underlying type checking issue persists.

altair (+653, -5)

missing-attribute on MarkMethodMixin: False positives - these attributes exist via mixin inheritance but pyrefly's stricter Self handling breaks attribute resolution
bad-argument-type with MarkMethodMixin: False positives - MarkMethodMixin objects should be compatible with Chart types through the mixin system
bad-return with @_ types: Type inference failure - the @_ type indicates pyrefly cannot properly infer the Self type

Overall: This is a regression. The PR removes a subtyping rule that was allowing ClassType to be assignable to SelfType, making pyrefly stricter than the established ecosystem standard. The 631 missing-attribute errors on MarkMethodMixin are false positives - these attributes exist via mixin inheritance but pyrefly can no longer resolve them properly. The bad-return error with Then[@_] vs Self@Then shows type inference degradation. While the PR aims for spec compliance, it creates significant false positive noise that mypy/pyright don't produce, making it practically unusable on real codebases like Altair.

Attribution: The changes in pyrefly/lib/solver/subset.rs removed the (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) subtyping rules. The changes in pyrefly/lib/alt/function.rs and pyrefly/lib/alt/call.rs added self_type_to_class_type() conversions to handle Self types more strictly.

artigraph (+30, -1)

This is a REGRESSION. The PR removed ClassType <: SelfType subtyping rules, making pyrefly stricter than the typing ecosystem standard. The new errors are false positives:

  1. bad-return errors: Code like return type(self) (line 77 in models.py) is standard Python - type(self) returns the actual class type, which should be assignable to Self. The error message shows type[Model] vs type[Self@Model], but these represent the same runtime value.

  2. bad-assignment error: The error shows TypedBox[V] | Self@TypedBox vs Self@TypedBox - this appears to be a type inference issue where the checker can't properly resolve the union type.

  3. Structural signal: 27/30 new errors contain @_ types, strongly indicating inference failures rather than real bugs.

  4. Removed error was correct: The removed no-matching-overload error was a false positive about descriptor access that works fine in practice.

The PR description states this is experimental ("WIP: [RFC]") and the author is "running mypy primer to see if this fix causes major regressions" - suggesting they expect this change to be problematic. Mypy/pyright would not flag these patterns because type(self) returning the actual class is fundamental to how Self works in Python.

Attribution: The changes in pyrefly/lib/solver/subset.rs removed the ClassType <: SelfType subtyping rules (lines removing (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) cases). Additionally, changes in pyrefly/lib/alt/function.rs and pyrefly/lib/alt/call.rs added self_type_to_class_type() conversions that transform SelfType to ClassType in various contexts, which created the new bad-return errors when the return type checking became stricter.

✅ Improvement (24)

urllib3 (+2)

These are genuine type violations that pyrefly is now correctly catching. The HTTPHeaderDict class has methods copy() and __ror__() that are annotated to return Self, but they return concrete HTTPHeaderDict instances instead. Line 437 in copy() does return clone where clone = type(self)(), and line 487 in __ror__() does return result where result = type(self)(maybe_constructable). While type(self)() creates an instance of the correct runtime type, the static type system sees this as returning HTTPHeaderDict rather than Self@HTTPHeaderDict. Per the typing spec, Self represents the actual class and should be preserved in return types. The PR removed the subtyping rule that incorrectly allowed concrete class types to be assignable to Self types, making pyrefly more spec-compliant.
Attribution: The change to subset.rs removed the subtyping rule that allowed ClassType to be assignable to SelfType. Specifically, the removal of the cases (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) from the subset checking logic means that HTTPHeaderDict is no longer considered assignable to Self@HTTPHeaderDict.

black (+1)

The PR intentionally removed the ClassType <: SelfType subtyping rule to make pyrefly's Self type checking more strict and spec-compliant. The error correctly identifies that assigning Leaf | Node (concrete class types) to a variable typed as Self@Base violates the stricter Self semantics. While the code works at runtime, the type system now properly enforces that Self represents the exact receiver type, not any subclass. This is an improvement in type system correctness, even though it flags previously accepted code.
Attribution: The change to subset checking in pyrefly/lib/solver/subset.rs removed the subtyping rules (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)), which previously allowed concrete class types to be assignable to Self types.

Expression (+2, -6)

This is an improvement. The PR correctly removes an invalid subtyping rule (ClassType <: SelfType) that was causing false positives in overload checking. The new errors expose genuine bugs in the Result.swap() method where type parameters are incorrectly swapped in constructor calls. The removed errors were false positives - the PipeMixin overloads are actually consistent, but the old subtyping rule was confusing the overload checker.
Attribution: The change to pyrefly/lib/solver/subset.rs removed the ClassType <: SelfType subtyping rule, which eliminated false positive overload errors but also exposed genuine type errors in the Result.swap() method that were previously masked by the incorrect subtyping relationship.

archinstall (+8)

These are genuine type violations being correctly caught. The typing spec defines Self as representing the actual class in inheritance hierarchies. When a method declares -> Self, returning the base class Shape() instead of cls() or self.__class__() violates this contract. Line 226 in PartitionTable.default() returns cls.GPT (a concrete enum value) when it should return cls(...) to maintain the Self contract. Line 426 in Size.align() and line 429 in Size.gpt_end() perform subtraction between Self@Size and Size, which is now correctly flagged as unsupported since the operand types don't match exactly. The PR removed overly permissive subtyping rules that incorrectly allowed concrete classes to be treated as Self types.
Attribution: The changes to subset.rs removed the subtyping rules that allowed ClassType <: SelfType, specifically the lines that made Type::ClassType(got) assignable to Type::SelfType(want). This removal now correctly enforces that concrete class types are not assignable to Self types.

ppb-vector (-2)

These removed errors were false positives. Looking at the Vector.new overloads on lines 110 and 113, they use pass as placeholder bodies, which is the standard Python pattern for overload declarations. The pass statement doesn't actually return None - it's just a syntactic placeholder. The actual implementation on line 115 correctly returns a Vector instance (Self@Vector). The typing spec allows overload signatures to use placeholder bodies, and the implementation's return type is what matters. Pyrefly was incorrectly treating the pass statements as explicit return None, creating false inconsistent-overload errors.
Attribution: The changes to pyrefly/lib/alt/function.rs in the bind_dunder_init_for_callable() method and overload checking logic removed the ClassType <: SelfType subtyping rule. This change made pyrefly stricter about Self type checking, causing it to now correctly flag when methods return concrete class types instead of Self.

core (+38, -4)

bad-return on Self violations: Correctly catches methods annotated -> Self that return concrete class instances instead of Self, enforcing proper Self semantics
inconsistent-overload false positives removed: Removes incorrect errors that claimed Self and class types were incompatible in overload signatures

Overall: This is an improvement. The new bad-return errors correctly identify violations of the Self type contract - when a method is annotated with -> Self, it should return Self (typically via cls() or similar), not a concrete class instantiation. The removed inconsistent-overload errors were false positives caused by overly strict comparison between Self and class types in overload signatures. The PR makes pyrefly more compliant with the typing spec's Self semantics while fixing incorrect error reporting.

Attribution: The changes in pyrefly/lib/solver/subset.rs removed the subtyping rules that allowed ClassType to be a subtype of SelfType, making the type system stricter about Self usage. The changes in pyrefly/lib/alt/function.rs added self_type_to_class_type() conversions in overload checking to avoid cycles, which likely fixed the false positive inconsistent-overload errors.

pyodide (+1, -2)

This is an improvement. The new error correctly identifies a genuine type violation where JsException._new_exc() declares it returns Self but actually returns a hardcoded JsException instance, breaking the Self contract. The removed errors were false positives incorrectly flagging valid overloads where the implementation raises exceptions. Per the typing spec, Self must represent the actual calling class type, not a hardcoded parent class.
Attribution: The new error is caused by changes in pyrefly/lib/alt/function.rs in the check_overloaded_function() method, specifically the addition of .[self_type_to_class_type()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/function.rs) calls that convert SelfType to ClassType for type checking. This makes pyrefly stricter about Self return type checking. The removed errors are likely due to changes in pyrefly/lib/solver/subset.rs that removed the (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) cases, which were allowing incorrect subtyping relationships.

pandera (+1, -2)

The new bad-override error correctly identifies a genuine type inconsistency. The PySpark DataFrameModel.validate method returns DataFrameBase[DataFrameModel] (a concrete type) but declares it returns DataFrameBase[Self]. This violates the Liskov substitution principle - subclasses should return the same Self type as their parent. The removed redundant-cast warnings were false positives since the casts are actually needed for type correctness. This is an improvement - pyrefly is now correctly enforcing Self-type semantics per the typing specification.
Attribution: The change to subtyping rules in pyrefly/lib/solver/subset.rs removed the (Type::ClassType(got), Type::SelfType(want)) case that allowed concrete classes to be subtypes of Self types. This exposed the type inconsistency in the validate method override.

rich (+8)

These are genuine type errors that pyrefly is now correctly catching. The code violates the Self type semantics - when a method is annotated to return Self, it must return an instance of the actual class (or subclass), not the base class. In rich/segment.py line 461, shaped_lines.extend([blank] * (_height - len(shaped_lines))) is trying to extend a list[list[Self@Segment]] with list[list[Segment]], but list[Segment] is not assignable to list[Self@Segment] because Segment is not assignable to Self@Segment. Similarly in rich/style.py lines 218 and 239, cls.__new__(Style) returns Style but the method signature expects Self. The PR correctly removed the overly permissive subtyping rule that allowed concrete classes to be treated as Self types.
Attribution: The change to subset.rs in pyrefly/lib/solver/subset.rs removed the subtyping rule that allowed ClassType <: SelfType (lines removing the cases for (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want))). This removal means pyrefly now correctly rejects cases where a concrete class type is returned when Self is expected.

pydantic (+6)

This is an improvement. The PR correctly enforces that methods annotated with -> Self must actually return Self, not concrete class instances. The errors are catching real type safety violations:

  1. In pydantic/fields.py:842, the _copy() method returns copied (a FieldInfo instance) but is annotated -> Self. This violates the Self contract.
  2. In pydantic/fields.py:1563, the __copy__() method in ComputedFieldInfo returns type(self)(...) but is annotated -> Self.
  3. In pydantic/main.py:988, the __copy__() method returns m (a BaseModel instance) but is annotated -> Self.

These are genuine type-level violations. When a subclass overrides these methods, the return type should be the subclass type (Self), not the base class type. The old behavior allowed Shape <: Self@Shape, which breaks type safety in inheritance hierarchies. For example, if Circle extends Shape, a method returning Shape() instead of the actual subclass instance violates the Liskov Substitution Principle at the type level.

The PR description indicates this is intentional spec compliance work ("Remove ClassType <: SelfType subtyping rule"), and the conformance test improvements show pyrefly is now correctly catching these violations that the typing spec requires.

Attribution: The change in pyrefly/lib/solver/subset.rs removed the subtyping rules (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) that previously allowed concrete class types to be considered subtypes of Self types. Additionally, changes in pyrefly/lib/alt/function.rs and pyrefly/lib/alt/call.rs added .[self_type_to_class_type()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/solver/subset.rs) conversions in various contexts to handle the stricter typing.

jinja (+3)

These are genuine type errors being correctly caught. The methods Shape.method() and Shape.cls_method() are declared to return Self, but they return Shape() instances instead. This violates the Self type contract - when a subclass calls these methods, they should return instances of the subclass, not the base class. The PR removed an overly permissive subtyping rule that incorrectly allowed concrete class types to satisfy Self type constraints. Per the typing spec, Self should represent the actual type of the calling class, not just any superclass.
Attribution: The change to remove the ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs (lines 1673-1680) caused these errors to appear. Previously, pyrefly allowed Shape (ClassType) to be considered a subtype of Self@Shape (SelfType), but now it correctly enforces that only the actual Self type satisfies the Self constraint.

streamlit (-1)

The removed error was a false positive. Looking at the code, the third overload signature def update(self, **kwds: str | Iterable[str]) -> None is perfectly compatible with the implementation def update(self, params=(), /, **kwds) -> None. When called with keyword arguments like obj.update(foo='bar'), the implementation receives params=() (the default) and **kwds={'foo': 'bar'}, which it correctly forwards to the underlying query params object. The error message claimed the implementation signature with params: tuple[()] | Unknown = ... couldn't accept arguments that the overload signature accepts, but this is incorrect - the implementation is more general and can handle all calls the overload allows. The PR changes to overload checking in pyrefly/lib/alt/function.rs correctly identified and removed this false positive by improving how Self types and method signatures are handled during overload validation.
Attribution: The change to overload checking in pyrefly/lib/alt/function.rs in the check_overloads() method added logic to convert SelfType to ClassType via self_type_to_class_type() and skip self/cls parameters when checking method overloads. This relaxed the overload consistency checking and removed the false positive error.

dedupe (-10)

The removed inconsistent-overload errors were false positives. Looking at the example error message: 'Overload return type Iterable[tuple[tuple[int, ...], ndarray[...] | tuple[float, ...]]] is not assignable to implementation return type list[tuple[tuple[int, ...], ndarray[...] | tuple[float, ...]]]' - this is backwards. In overload checking, the implementation return type should be assignable to each overload return type, not the other way around. Since list is a subtype of Iterable, the implementation returning list can satisfy an overload promising Iterable. The PR fixed the overload consistency checking logic by properly handling Self types and method signatures, removing these incorrect errors.
Attribution: The changes in pyrefly/lib/alt/function.rs to the check_overloads() method modified overload consistency checking. Specifically, the addition of self_type_to_class_type() calls and the conditional skipping of return type checks for methods (if def.[defining_cls()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/function.rs).[is_none()](https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/function.rs)) changed how overload signatures are validated, which removed the false positive inconsistent-overload errors.

strawberry (+2)

These are genuine type violations being correctly caught. In both errors, methods declare return type Self but return instances of the concrete base class instead of the actual class. Line 141 in base.py shows return type(self)(of_type_copy) where type(self) creates an instance of the actual subclass (correct), but the error suggests the return type inference is seeing just StrawberryContainer instead of the generic Self. Line 192 in field.py shows return new_field where new_field is created via type(self)(...) - again the pattern is correct but the type inference may not be recognizing that type(self) produces a Self type. The PR removed the ClassType <: SelfType subtyping rule, making pyrefly stricter about Self return types, which aligns with the typing spec requirement that Self methods return instances of the actual class.
Attribution: The change to self_type_to_class_type() in pyrefly/lib/solver/subset.rs removed the subtyping rule that allowed ClassType <: SelfType. This removal means pyrefly now correctly enforces that methods returning Self must return instances of the actual class, not the base class.

hydra-zen (+1)

This is an improvement. The error correctly identifies a type-level Liskov substitution violation. When a method declares return -> Self, it promises to return an instance of the actual class that called the method (which could be a subclass). Returning Shape() directly violates this contract because it always returns the base class, breaking polymorphism. For example, if Circle(Shape) calls this method, it should get a Circle instance back, not a Shape instance. The PR removed the ClassType <: SelfType subtyping rule in subset.rs, which was incorrectly allowing this violation. Per the typing spec, Self represents 'the enclosing class' and should preserve the actual runtime class type.
Attribution: The change to subset.rs in pyrefly/lib/solver/subset.rs removed the subtyping rule that allowed ClassType <: SelfType. This removal means pyrefly now correctly enforces that returning a concrete class instance (like Shape()) is not compatible with a Self return type annotation.

prefect (+221, -54)

This is an improvement. The PR correctly implements Self type semantics per the typing spec. The new errors catch genuine violations where code returns concrete class instances instead of preserving the Self type contract. For example, methods annotated as -> Self that return base class instances break the Liskov substitution principle - subclasses calling these methods would get the wrong type. The removed errors were false positives about missing attributes and overly strict overload checks. While the new errors may require code changes, they enforce correct typing semantics that prevent real bugs in inheritance hierarchies.
Attribution: The changes in pyrefly/lib/solver/subset.rs removed the subtyping rules that allowed ClassType <: SelfType and Type[ClassType] <: SelfType. The changes in pyrefly/lib/alt/function.rs added self_type_to_class_type() calls to convert Self types to concrete class types in various contexts. The changes in pyrefly/lib/alt/call.rs also handle Self type conversion in constructor contexts.

static-frame (+43, -2)

bad-return: These correctly identify methods that declare -> Self but return concrete class types instead of preserving the subclass type, which violates PEP 673's Self type semantics
missing-attribute: These appear to be false positives where the type checker cannot resolve attributes like extend and extend_items on Frame objects, likely due to the Self type changes affecting type resolution
bad-assignment: These correctly identify type mismatches where specific Frame types cannot be assigned to FrameGO types

Overall: This is an improvement. The new errors correctly identify violations of the Self type contract per PEP 673. When a method declares -> Self, it must return an instance that preserves the subclass type, not just any instance of the base class. For example, in static_frame/core/frame.py:779, the method from_concat_items declares -> tp.Self but returns cls.from_concat(...) which resolves to Frame[TVIndex, TVColumns, TVDtypes] rather than the specific Self@Frame type. This violates the Liskov substitution principle - if a subclass overrides this method, callers expect to get back an instance of that subclass, not the base Frame class. The removed errors about _odict_items not being assignable to Iterable[tuple[TLabel, Series]] were catching a real type mismatch that should be flagged.

Attribution: The change to remove the ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs (lines 1673-1682) caused these errors to appear. The PR also added self_type_to_class_type() conversions in multiple places to handle Self types more correctly.

mypy (+7, -7)

This is an improvement. The removed errors were false positives caused by pyrefly's type inference failing when processing complex generic callable signatures in typeshed. The error messages containing @_ types are a clear indicator of inference failures rather than real type violations. The typeshed stubs are extensively tested and these @classmethod patterns are standard Python that mypy/pyright handle correctly. The PR's removal of the ClassType <: SelfType subtyping rule and addition of explicit SelfType-to-ClassType conversion methods fixes the inference issues that were generating these spurious errors.
Attribution: The change to remove ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs (lines 1673-1682) eliminated the problematic subtyping relationship. Additionally, the new self_type_to_class_type() method added in crates/pyrefly_types/src/callable.rs and crates/pyrefly_types/src/types.rs converts SelfType to ClassType in various contexts, which helps resolve the type inference issues that were causing the @_ types in error messages.

pip (+8)

These are false positive errors caused by pyrefly being too strict about Self type compatibility. The errors occur in two locations:

  1. Line 430 in segment.py: shaped_lines.extend([blank] * (_height - len(shaped_lines))) where blank is list[Segment] but the method expects Iterable[list[Self@Segment]]
  2. Lines 218 and 239 in style.py: cls.__new__(Style) where Style is passed but Self@Style is expected

The PR removed the subtyping rule that ClassType <: SelfType, making pyrefly reject patterns where a concrete class type (like Segment or Style) is used where Self@ClassName is expected. However, this is overly restrictive - in these contexts, the concrete class should be compatible with Self since Self represents the same class. The typing spec allows this flexibility, and other type checkers (mypy/pyright) would not flag these patterns as errors.

Attribution: The changes to pyrefly/lib/solver/subset.rs removed the subtyping rules that allowed ClassType <: SelfType (lines removing (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) cases). This removal caused pyrefly to become stricter about Self type compatibility, leading to these new errors.

pycryptodome (+1)

This is an improvement. The code has a genuine bug where self.__new__(CMAC) hardcodes the class type instead of using the dynamic type. This breaks inheritance - if someone subclasses CMAC, the copy() method would incorrectly return a CMAC instance instead of the subclass instance. The fix should be obj = type(self)() or similar. Pyrefly is correctly identifying a violation of the Self type contract per the typing spec.
Attribution: The removal of ClassType <: SelfType subtyping rules in pyrefly/lib/solver/subset.rs caused this error. Previously, type[CMAC] was considered assignable to type[Self@CMAC], but this subtyping relationship was removed.

sphinx (+8)

These are genuine type errors that pyrefly is now correctly catching. The error message 'Symbol | Self@Symbol is not assignable to Self@Symbol' indicates that pyrefly detected a union type where only Self@Symbol was expected. Looking at the code, in the while loops at lines 246-248 and 259-261, the variable s starts as self (which has type Self@Symbol) but gets reassigned to s.parent (which has type Symbol | None). This creates a union type Symbol | Self@Symbol that cannot be assigned back to the Self@Symbol type. The PR removed the ClassType <: SelfType subtyping rule, making pyrefly stricter about Self type usage, which correctly identifies this type inconsistency. This matches the conformance test improvements shown in the diff where pyrefly now properly flags return Shape() in methods declared to return Self.
Attribution: The change to pyrefly/lib/solver/subset.rs removed the subtyping rules (Type::ClassType(got), Type::SelfType(want)) and (Type::Type(box Type::ClassType(got)), Type::SelfType(want)) that allowed ClassType to be assignable to SelfType. This removal caused pyrefly to correctly flag cases where concrete classes are returned instead of Self.

python-chess (+12)

This is an improvement. The PR correctly implements PEP 673 Self type semantics by removing an incorrect subtyping rule. The chess library code has genuine type violations - methods like BaseBoard.copy() and Board.root() are declared to return Self but actually return concrete class instances like BaseBoard() and Board(). Per PEP 673, Self represents the enclosing class and methods returning Self should maintain the actual runtime type. The old behavior was a bug in pyrefly that incorrectly allowed ClassType to be a subtype of SelfType. These are real type-level Liskov substitution violations that pyrefly is now correctly catching.
Attribution: The change to remove the ClassType <: SelfType subtyping rule in pyrefly/lib/solver/subset.rs caused these errors to appear. Previously, pyrefly incorrectly allowed concrete class types to be considered subtypes of Self types.

psycopg (+1)

This is an improvement. The error correctly identifies a violation of the Self type contract per the typing spec. In the code at line 107, connection_summary(self) expects a parameter of type psycopg.psycopg.pq.abc.PGconn (the abstract base class), but receives Self@psycopg.psycopg.pq.pq_ctypes.PGconn (the concrete implementation class). The PR removed the subtyping rule that incorrectly allowed concrete class types to be treated as subtypes of Self types. This change makes pyrefly's Self type checking more precise and spec-compliant - Self should represent the actual runtime type, not be freely interchangeable with concrete class instances. The error reveals that the connection_summary function should accept the concrete implementation type or the code should pass a properly typed argument.
Attribution: The change to pyrefly/lib/solver/subset.rs removed the subtyping rules that allowed ClassType <: SelfType (lines 1673-1680 in the diff). This removal means pyrefly now correctly rejects cases where concrete class instances are returned from methods declared to return Self.

egglog-python (+2, -1)

bad-return errors: These correctly catch violations where methods return concrete classes instead of Self, which breaks the Self type contract
bad-argument-type error: This appears to be a false positive - list[TypedExprDecl] should be compatible with Iterable[Self@TypedExprDecl] when Self is bound to TypedExprDecl
removed inconsistent-overload: This was correctly identified as a false positive and removed

Overall: The new bad-return errors correctly identify violations of the Self type contract - methods declared to return Self should not return concrete class instances, as this breaks the polymorphic contract that subclasses expect. The bad-argument-type error appears to be a false positive caused by overly strict Self type checking. The removed inconsistent-overload error was correctly identified as a false positive and removed.

Attribution: The changes in pyrefly/lib/solver/subset.rs removed the (Type::ClassType(got), Type::SelfType(want)) subtyping rule, which caused the new bad-argument-type and bad-return errors. The changes in pyrefly/lib/alt/function.rs to skip return type checks for methods removed the false positive inconsistent-overload error.

➖ Neutral (4)

tornado (+3, -3)

Same errors at same locations with same error kinds — message wording changed, no behavioral impact.

mkdocs (+1, -1)

Same errors at same locations with same error kinds — message wording changed, no behavioral impact.

mitmproxy (+1, -1)

Same errors at same locations with same error kinds — message wording changed, no behavioral impact.

bokeh (+1, -1)

Same errors at same locations with same error kinds — message wording changed, no behavioral impact.

Suggested Fix

Summary: The PR removes ClassType <: SelfType subtyping rule too broadly, causing false positives in legitimate patterns like super().new(cls) and type(self)() constructors.

1. In is_subset_eq() in pyrefly/lib/solver/subset.rs, restore the ClassType <: SelfType subtyping rule but guard it with a context check: allow the subtyping only in constructor contexts (when checking new methods or type(self)() patterns) and method return contexts where the ClassType is the same as the SelfType's underlying class. This preserves legitimate patterns while maintaining stricter checking for genuine violations.

Files: pyrefly/lib/solver/subset.rs
Confidence: high
Affected projects: trio, mongo-python-driver, dd-trace-py, parso, isort, jax, artigraph
Fixes: bad-return, bad-assignment
The removed subtyping rule was handling legitimate patterns like super().new(cls) in constructors and type(self)() in methods. Restoring it with proper guards eliminates 12+ bad-return and bad-assignment errors across trio, mongo-python-driver, dd-trace-py, parso, isort, jax, and artigraph while preserving the spec compliance improvements.

2. In check_overloaded_function() in pyrefly/lib/alt/function.rs, restore the overload return type consistency checking that was removed. The current code skips return type checks for methods (line 1652-1658), but this was catching legitimate type safety issues. Add back the return type assignability check: overload return types should be assignable to implementation return types.

Files: pyrefly/lib/alt/function.rs
Confidence: medium
Affected projects: hydpy
Fixes: removed overload consistency check
The hydpy project shows a removed overload consistency check that was catching a legitimate issue where implementation return type was narrower than overload return type. Restoring this check eliminates the regression in hydpy while maintaining type safety.

3. In self_type_to_class_type() in crates/pyrefly_types/src/callable.rs and crates/pyrefly_types/src/types.rs, add a guard to preserve SelfType in contexts where type inference is critical. When converting SelfType to ClassType, check if we're in a generic context or callable proxy context - if so, preserve the SelfType to avoid inference failures that produce Never types.

Files: crates/pyrefly_types/src/callable.rs, crates/pyrefly_types/src/types.rs
Confidence: medium
Affected projects: operator, scrapy, optuna
Fixes: bad-assignment, missing-attribute
The operator project shows type inference failure with CallableProxyType[Never] instead of CallableProxyType[Framework], indicating the SelfType conversion is too aggressive and breaks inference. Adding guards preserves inference quality while maintaining the intended Self type handling improvements.


Was this helpful? React with 👍 or 👎

Classification by primer-classifier (4 heuristic, 39 LLM)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant