[ty] Treat __setattr__ as fallback-only by charliermarsh · Pull Request #22014 · astral-sh/ruff (original) (raw)
mypy_primer results
Changes were detected when running on open source projects
spack (https://github.com/spack/spack)
- lib/spack/spack/vendor/typing_extensions.py:863:17: error[invalid-assignment] Object of type
def _no_init(self, *args, **kwargs) -> Unknownis not assignable to attribute__init__of typedef __init__(cls, *args, **kwargs) -> Unknown
- Found 4294 diagnostics
- Found 4295 diagnostics
werkzeug (https://github.com/pallets/werkzeug)
- src/werkzeug/datastructures/auth.py:205:9: error[unresolved-attribute] Cannot assign object of type
CallbackDict[str, str]to attribute_parameterson typeSelf@parameterswith custom__setattr__method. - src/werkzeug/sansio/response.py:597:9: error[unresolved-attribute] Cannot assign object of type
def on_update(value: WWWAuthenticate) -> Noneto attribute_on_updateon typeWWWAuthenticatewith custom__setattr__method. - src/werkzeug/sansio/response.py:620:13: error[invalid-assignment] Object of type
def on_update(value: WWWAuthenticate) -> Noneis not assignable to attribute_on_updateon typeWWWAuthenticate & ~AlwaysFalsy & ~Top[list[Unknown]] - Found 385 diagnostics
- Found 382 diagnostics
scrapy (https://github.com/scrapy/scrapy)
- tests/test_extension_telnet.py:16:9: error[invalid-assignment] Object of type
<class 'dict'>is not assignable to attribute_get_telnet_varsof typedef _get_telnet_vars(self) -> dict[str, Any]
- Found 1789 diagnostics
- Found 1790 diagnostics
paasta (https://github.com/yelp/paasta)
- paasta_tools/cli/cmds/mark_for_deployment.py:849:17: error[invalid-assignment] Object of type
Noneis not assignable to attributepaasta_status_reminder_handleof typeTimerHandle
- Found 1106 diagnostics
- Found 1107 diagnostics
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- examples/contrib/upstream_pac.py:90:13: error[invalid-assignment] Object of type
tuple[str, tuple[str, int]]is not assignable to attributeviaof typetuple[Literal["http", "https", "http3", "tls", "dtls", ... omitted 4 literals], tuple[str, int]] | None - test/mitmproxy/addons/test_next_layer.py:374:17: error[invalid-assignment] Object of type
tuple[Literal["2001:db8::1"], Literal[443], Literal[0], Literal[0]] | tuple[Literal["192.0.2.1"], Literal[443]]is not assignable to attributepeernameof typetuple[str, int] | None - test/mitmproxy/addons/test_tlsconfig.py:439:17: error[invalid-assignment] Object of type
Noneis not assignable to attributealpn_offersof typeSequence[bytes] - test/mitmproxy/tools/console/test_flowview.py:92:5: error[invalid-assignment] Object of type
MagicMockis not assignable to attribute_get_content_viewof type_lru_cache_wrapper[Unknown]
- Found 2144 diagnostics
- Found 2148 diagnostics
pydantic (https://github.com/pydantic/pydantic)
- pydantic/fields.py:943:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:943:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:983:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:983:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:1026:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:1026:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:1066:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:1066:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:1109:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:1109:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:1148:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:1148:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:1188:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None
- pydantic/fields.py:1188:5: error[invalid-parameter-default] Default value of type
PydanticUndefinedTypeis not assignable to annotated parameter typedict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None
- pydantic/fields.py:1567:13: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None, foundTop[dict[Unknown, Unknown]] | (((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None
- pydantic/fields.py:1567:13: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None, foundTop[dict[Unknown, Unknown]] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None
optuna (https://github.com/optuna/optuna)
- optuna/storages/_rdb/storage.py:325:17: error[invalid-assignment] Invalid assignment to data descriptor attribute
value_jsonon typeStudyUserAttributeModelwith custom__set__method - optuna/storages/_rdb/storage.py:337:17: error[invalid-assignment] Invalid assignment to data descriptor attribute
value_jsonon typeStudySystemAttributeModelwith custom__set__method - optuna/storages/_rdb/storage.py:572:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
stateon typeTrialModelwith custom__set__method - optuna/storages/_rdb/storage.py:574:9: error[invalid-assignment] Invalid assignment to data descriptor attribute
numberon typeTrialModelwith custom__set__method - optuna/storages/_rdb/storage.py:668:17: error[invalid-assignment] Invalid assignment to data descriptor attribute
stateon typeTrialModelwith custom__set__method - optuna/storages/_rdb/storage.py:671:21: error[invalid-assignment] Invalid assignment to data descriptor attribute
datetime_starton typeTrialModelwith custom__set__method - optuna/storages/_rdb/storage.py:674:21: error[invalid-assignment] Invalid assignment to data descriptor attribute
datetime_completeon typeTrialModelwith custom__set__method - optuna/storages/_rdb/storage.py:699:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
valueon typeTrialValueModelwith custom__set__method - optuna/storages/_rdb/storage.py:700:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
value_typeon typeTrialValueModelwith custom__set__method - optuna/storages/_rdb/storage.py:738:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
intermediate_valueon typeTrialIntermediateValueModelwith custom__set__method - optuna/storages/_rdb/storage.py:739:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
intermediate_value_typeon typeTrialIntermediateValueModelwith custom__set__method - optuna/storages/_rdb/storage.py:805:17: error[invalid-assignment] Object of type
stris not assignable to attributevalue_jsonon typeTrialUserAttributeModel | TrialSystemAttributeModel - optuna/storages/_rdb/storage.py:1035:17: error[invalid-assignment] Invalid assignment to data descriptor attribute
heartbeaton typeTrialHeartbeatModelwith custom__set__method - optuna/storages/_rdb/storage.py:1193:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
schema_versionon typeVersionInfoModelwith custom__set__method - optuna/storages/_rdb/storage.py:1194:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
library_versionon typeVersionInfoModelwith custom__set__method - tests/storages_tests/rdb_tests/test_storage.py:160:9: error[invalid-assignment] Object of type
Literal[11]is not assignable to attributeschema_versionon typeUnknown | VersionInfoModel - tests/storages_tests/rdb_tests/test_storage.py:361:13: error[invalid-assignment] Invalid assignment to data descriptor attribute
numberon typeTrialModelwith custom__set__method
- Found 560 diagnostics
- Found 577 diagnostics
comtypes (https://github.com/enthought/comtypes)
- comtypes/_post_coinit/misc.py:378:46: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - Found 396 diagnostics
- Found 395 diagnostics
trio (https://github.com/python-trio/trio)
- src/trio/_ssl.py:781:43: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - Found 484 diagnostics
- Found 483 diagnostics
xarray (https://github.com/pydata/xarray)
- xarray/core/dataarray.py:473:9: error[invalid-assignment] Object of type
(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | dict[Hashable, Variable | Unknown]is not assignable to attribute_coordsof typedict[Any, Variable]
- xarray/tests/test_dataarray.py:167:40: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - xarray/tests/test_datatree.py:212:36: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - Found 1765 diagnostics
- Found 1764 diagnostics
openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/accounts/model.py:603:9: error[invalid-assignment] Cannot assign to read-only property
last_loginon object of typeSelf@update_last_login: Attempted assignment toSelf@update_last_login.last_loginhere
- Found 1155 diagnostics
- Found 1156 diagnostics
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- tests/tracer/test_pin.py:76:13: error[invalid-assignment] Cannot assign to read-only property
serviceon object of typePin: Attempted assignment toPin.servicehere
- Found 8424 diagnostics
- Found 8425 diagnostics
ibis (https://github.com/ibis-project/ibis)
- ibis/common/tests/test_egraph.py:153:9: error[invalid-assignment] Object of type
Literal[2]is not assignable to attributeheadof typetype - ibis/expr/rewrites.py:152:9: error[invalid-assignment] Object of type
dict[Unknown, Unknown]is not assignable to attributesubsof typeFrozenDict[Value[Unknown, Any], Field] | None - ibis/expr/rewrites.py:153:9: error[invalid-assignment] Object of type
dict[Unknown, Unknown]is not assignable to attributeambigsof typeFrozenDict[Value[Unknown, Any], tuple[Value[Unknown, Any], ...]] | None
- Found 4608 diagnostics
- Found 4611 diagnostics
hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/parametertools.py:2679:9: error[unresolved-attribute] Cannot assign object of type
list[Unknown]to attribute_toy2values_unprotectedon typeSelf@__init__with custom__setattr__method. - hydpy/core/parametertools.py:2696:13: error[unresolved-attribute] Cannot assign object of type
tuple[Literal[-1]]to attributeshapeon typeSelf@__call__with custom__setattr__method. - hydpy/core/parametertools.py:2703:13: error[unresolved-attribute] Cannot assign object of type
list[Unknown | tuple[TOY, Unknown]]to attribute_toy2values_unprotectedon typeSelf@__call__with custom__setattr__method. - hydpy/core/parametertools.py:2706:13: error[unresolved-attribute] Cannot assign object of type
list[Unknown]to attribute_toy2values_unprotectedon typeSelf@__call__with custom__setattr__method. - hydpy/models/dam/dam_control.py:93:9: error[unresolved-attribute] Cannot assign object of type
tuple[Literal[-1]]to attributeshapeon typeSelf@__call__with custom__setattr__method. - Found 684 diagnostics
- Found 679 diagnostics
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/frame.py:3491:38: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - static_frame/core/frame.py:3543:38: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - static_frame/core/frame.py:3573:34: warning[unused-ignore-comment] Unused blanket
type: ignoredirective
- static_frame/core/index_hierarchy.py:1145:13: error[invalid-assignment] Object of type
list[IndexBase | Unknown]is not assignable to attribute_indicesof typelist[Index[Any]] - static_frame/core/index_hierarchy.py:1168:9: error[invalid-assignment] Object of type
list[IndexBase | Unknown]is not assignable to attribute_indicesof typelist[Index[Any]]
- Found 1843 diagnostics
- Found 1842 diagnostics
pandas (https://github.com/pandas-dev/pandas)
- pandas/core/groupby/generic.py:2217:39: warning[unused-ignore-comment] Unused blanket
type: ignoredirective - Found 3748 diagnostics
- Found 3747 diagnostics
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/test_config.py:69:5: error[unresolved-attribute] Cannot assign object of type
floatto attributechop_thresholdon typeDisplaywith custom__setattr__method. - Found 5027 diagnostics
- Found 5026 diagnostics
core (https://github.com/home-assistant/core)
- homeassistant/components/airvisual/init.py:220:5: error[invalid-assignment] Object of type
DataUpdateCoordinator[dict[str, Any] | None]is not assignable to attributeruntime_dataof typeDataUpdateCoordinator[dict[str, Any]]
- homeassistant/util/variance.py:47:12: error[invalid-return-type] Return type does not match returned value: expected
(**_P@ignore_variance) -> _R@ignore_variance, found_Wrapped[_P@ignore_variance, _R@ignore_variance | int | float | datetime, _P@ignore_variance, _R@ignore_variance | int | float | datetime]
No memory usage changes detected ✅