Repository navigation
builtins: make type.__call__ return object - #9215
Closed
JelleZijlstra wants to merge 1 commit into
Closed
JelleZijlstra wants to merge 1 commit into
JelleZijlstra wants to merge 1 commit into
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: jax (https://github.com/google/jax)
+ jax/core.py:1767: error: Incompatible return value type (got "object", expected "Optional[DimensionHandler]") [return-value]
+ jax/interpreters/partial_eval.py:2356: error: Incompatible return value type (got "object", expected "AbstractValue") [return-value]
tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/httpclient_test.py:505: error: Unsupported target for indexed assignment ("object") [index]
manticore (https://github.com/trailofbits/manticore)
+ manticore/wasm/types.py:54: error: Value of type variable "_CT" of "pointer" cannot be "object" [type-var]
+ manticore/core/worker.py:362: error: "object" has no attribute "states" [attr-defined]
+ manticore/wasm/structure.py:1109: error: Argument 1 to "append" of "list" has incompatible type "object"; expected "Union[I32, I64, F32, F64, BitVec]" [arg-type]
+ manticore/platforms/wasm.py:296: error: Argument 1 to "GlobalInst" has incompatible type "object"; expected "Union[I32, I64, F32, F64, BitVec]" [arg-type]
+ manticore/native/cpu/cpufactory.py:35: error: Incompatible return value type (got "object", expected "Cpu") [return-value]
core (https://github.com/home-assistant/core)
+ homeassistant/components/acmeda/helpers.py:34: error: Argument 1 to "__call__" of "AddEntitiesCallback" has incompatible type "List[object]"; expected "Iterable[Entity]" [arg-type]
+ homeassistant/components/omnilogic/switch.py:54: error: Argument 1 to "__call__" of "AddEntitiesCallback" has incompatible type "List[object]"; expected "Iterable[Entity]" [arg-type]
+ homeassistant/components/omnilogic/sensor.py:57: error: Argument 1 to "__call__" of "AddEntitiesCallback" has incompatible type "List[object]"; expected "Iterable[Entity]" [arg-type]
+ homeassistant/components/homekit_controller/button.py:78: error: Argument 1 to "append" of "list" has incompatible type "object"; expected "Union[HomeKitButton, HomeKitEcobeeClearHoldButton]" [arg-type]
pandera (https://github.com/pandera-dev/pandera)
+ pandera/engines/pandas_engine.py:178: error: "object" has no attribute "name" [attr-defined]
black (https://github.com/psf/black)
+ src/black/linegen.py:535:21: error: List item 6 has incompatible type "object"; expected "Callable[[Line, Collection[Feature]], Iterator[Line]]" [list-item]
+ src/black/linegen.py:543:21: error: List item 4 has incompatible type "object"; expected "Callable[[Line, Collection[Feature]], Iterator[Line]]" [list-item]
+ src/black/linegen.py:547:76: error: List item 2 has incompatible type "object"; expected "Callable[[Line, Collection[Feature]], Iterator[Line]]" [list-item]
+ src/black/linegen.py:549:33: error: List item 0 has incompatible type "object"; expected "Callable[[Line, Collection[Feature]], Iterator[Line]]" [list-item]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/indexes/datetimes.py:1065: error: Incompatible types in assignment (expression has type "object", variable has type "Union[str, BaseOffset]") [assignment]
spark (https://github.com/apache/spark)
+ python/pyspark/sql/types.py:1472: error: Incompatible return value type (got "object", expected "DataType") [return-value]
optuna (https://github.com/optuna/optuna)
+ optuna/distributions.py:614: error: Incompatible return value type (got "object", expected "BaseDistribution") [return-value]
+ benchmarks/bayesmark/optuna_optimizer.py:71: error: Argument "sampler" to "create_study" has incompatible type "object"; expected "Optional[BaseSampler]" [arg-type]
+ benchmarks/bayesmark/optuna_optimizer.py:72: error: Argument "pruner" to "create_study" has incompatible type "object"; expected "Optional[BasePruner]" [arg-type]
ibis (https://github.com/ibis-project/ibis)
+ ibis/common/grounds.py:35: error: Incompatible return value type (got "object", expected "Base") [return-value]
pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/main.py:691: error: Incompatible return value type (got "object", expected "Type[Model]") [return-value]
rich (https://github.com/Textualize/rich)
+ rich/prompt.py:231: error: Incompatible types in assignment (expression has type "object", variable has type "PromptType") [assignment]
artigraph (https://github.com/artigraph/artigraph)
+ tests/arti/internal/test_models.py:203: error: No overload variant of "dict" matches argument type "object" [call-overload]
+ tests/arti/internal/test_models.py:203: note: Possible overload variants:
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self) -> Dict[_KT, _VT]
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self, **kwargs: _VT) -> Dict[str, _VT]
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self, SupportsKeysAndGetItem[_KT, _VT], /) -> Dict[_KT, _VT]
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self, SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> Dict[str, _VT]
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self, Iterable[Tuple[_KT, _VT]], /) -> Dict[_KT, _VT]
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self, Iterable[Tuple[str, _VT]], /, **kwargs: _VT) -> Dict[str, _VT]
+ tests/arti/internal/test_models.py:203: note: def [_KT, _VT] __init__(self, Iterable[List[str]], /) -> Dict[str, str]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/json.py:412: error: Incompatible return value type (got "object", expected "BaseCacheSet") [return-value]
graphql-core (https://github.com/graphql-python/graphql-core)
+ src/graphql/type/definition.py:842: error: Exception must be derived from BaseException [misc]
+ src/graphql/type/definition.py:873: error: Exception must be derived from BaseException [misc]
+ src/graphql/type/definition.py:976: error: Exception must be derived from BaseException [misc]
+ src/graphql/type/definition.py:1007: error: Exception must be derived from BaseException [misc]
+ src/graphql/type/definition.py:1107: error: Exception must be derived from BaseException [misc]
+ src/graphql/type/definition.py:1490: error: Exception must be derived from BaseException [misc]
bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch/configuration.py: note: In member "__call__" of class "Singleton":
+ src/bandersnatch/configuration.py:35: error: Incompatible types in assignment (expression has type "object", target has type "Type[Any]") [assignment]
+ src/bandersnatch_storage_plugins/swift.py: note: In member "open_file" of class "SwiftStorage":
+ src/bandersnatch_storage_plugins/swift.py:768: error: Incompatible types in assignment (expression has type "object", variable has type "IO[Any]") [assignment]
|
Member
Author
|
This is too disruptive, mypy will need an alternative solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Helps with python/mypy#10482