-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Experiment: what happens if we just remove the second overload of dict.pop?
#15303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
randolf-scholz
wants to merge
1
commit into
python:main
Choose a base branch
from
randolf-scholz:dict_pop_remove_overload
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Experiment: what happens if we just remove the second overload of dict.pop?
#15303
randolf-scholz
wants to merge
1
commit into
python:main
from
randolf-scholz:dict_pop_remove_overload
+0
−20
Conversation
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
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: pandera (https://github.com/pandera-dev/pandera)
+ pandera/schema_statistics/pandas.py:81: error: Need type annotation for "options" [var-annotated]
spark (https://github.com/apache/spark)
+ python/pyspark/sql/plot/plotly.py:192: error: Argument "bw_method" to "compute_kde_col" of "PySparkKdePlotBase" has incompatible type "Any | None"; expected "int | float" [arg-type]
setuptools (https://github.com/pypa/setuptools)
+ setuptools/config/_apply_pyprojecttoml.py:285: error: Need type annotation for "given" [var-annotated]
pylox (https://github.com/sco1/pylox)
- pylox/containers/array.py:83: note: def pop(self, Any, Any, /) -> Any
alerta (https://github.com/alerta/alerta)
+ alerta/webhooks/prometheus.py:85: error: Argument "resource" to "Alert" has incompatible type "Any | None"; expected "str" [arg-type]
rotki (https://github.com/rotki/rotki)
+ rotkehlchen/api/rest.py:457: error: Value of type "Any | None" is not indexable [index]
+ rotkehlchen/api/rest.py:459: error: Value of type "Any | None" is not indexable [index]
+ rotkehlchen/api/rest.py:460: error: Item "None" of "Any | None" has no attribute "get" [union-attr]
sympy (https://github.com/sympy/sympy)
+ sympy/plotting/plot.py:412: error: Need type annotation for "labels" [var-annotated]
+ sympy/plotting/plot.py:607: error: Need type annotation for "labels" [var-annotated]
+ sympy/plotting/plot.py:738: error: Need type annotation for "labels" [var-annotated]
+ sympy/plotting/plot.py:1037: error: Need type annotation for "labels" [var-annotated]
xarray (https://github.com/pydata/xarray)
+ xarray/plot/facetgrid.py: note: In member "map_plot1d" of class "FacetGrid":
+ xarray/plot/facetgrid.py:450: error: Need type annotation for "cbar_kwargs" [var-annotated]
+ xarray/plot/facetgrid.py: note: At top level:
+ xarray/plot/dataarray_plot.py: note: In function "_plot1d":
+ xarray/plot/dataarray_plot.py:983: error: Need type annotation for "cmap_params_subset" [var-annotated]
+ xarray/plot/dataarray_plot.py:984: error: Need type annotation for "cbar_kwargs" [var-annotated]
+ xarray/indexes/nd_point_index.py: note: In member "from_variables" of class "NDPointIndex":
+ xarray/indexes/nd_point_index.py:269: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "type[T_TreeAdapter]" [arg-type]
materialize (https://github.com/MaterializeInc/materialize)
+ misc/python/materialize/mzbuild.py:459: error: Unsupported operand types for / ("Path" and "None") [operator]
+ misc/python/materialize/mzbuild.py:459: note: Right operand is of type "Any | None"
+ misc/python/materialize/mzbuild.py:461: error: Unsupported operand types for / ("Path" and "None") [operator]
+ misc/python/materialize/mzbuild.py:461: note: Right operand is of type "Any | None"
+ misc/python/materialize/mzbuild.py:464: error: Unsupported operand types for / ("Path" and "None") [operator]
+ misc/python/materialize/mzbuild.py:464: note: Right operand is of type "Any | None"
+ misc/python/materialize/mzbuild.py:508: error: Need type annotation for "bin" [var-annotated]
+ misc/python/materialize/mzbuild.py:510: error: Need type annotation for "example" [var-annotated]
+ misc/python/materialize/mzbuild.py:513: error: Need type annotation for "extract" [var-annotated]
core (https://github.com/home-assistant/core)
+ homeassistant/helpers/check_config.py:160: error: Need type annotation for "core_config" [var-annotated]
+ homeassistant/components/light/__init__.py:330: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "int" [arg-type]
+ homeassistant/components/light/__init__.py:340: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "int" [arg-type]
+ homeassistant/helpers/config_entry_oauth2_flow.py:717: error: Need type annotation for "headers" [var-annotated]
+ homeassistant/components/netatmo/config_flow.py:119: error: Need type annotation for "areas" [var-annotated]
+ homeassistant/components/template/config_flow.py:861: error: Need type annotation for "advanced_options" [var-annotated]
isort (https://github.com/pycqa/isort)
+ isort/output.py:333: error: Argument 1 to "add_to_line" has incompatible type "Any | tuple[()]"; expected "list[str] | None" [arg-type]
+ isort/output.py:471: error: Need type annotation for "use_comments" (hint: "use_comments: list[<type>] = ...") [var-annotated]
+ isort/output.py:473: error: Incompatible types in assignment (expression has type "Any | tuple[()]", variable has type "list[Any]") [assignment]
+ isort/output.py:473: error: Incompatible types in assignment (expression has type "Any | tuple[()] | None", variable has type "list[Any]") [assignment]
+ isort/output.py:500: error: Argument 1 to "add_to_line" has incompatible type "Any | tuple[()]"; expected "list[str] | None" [arg-type]
+ isort/output.py:500: error: Argument 1 to "add_to_line" has incompatible type "Any | tuple[()] | None"; expected "list[str] | None" [arg-type]
+ isort/output.py:534: error: Argument "comments" to "import_statement" has incompatible type "Any | tuple[()] | None"; expected "Sequence[str]" [arg-type]
+ isort/output.py:544: error: Argument "comments" to "import_statement" has incompatible type "Any | tuple[()] | None"; expected "Sequence[str]" [arg-type]
+ isort/output.py:552: error: Argument "comments" to "import_statement" has incompatible type "Any | tuple[()] | None"; expected "Sequence[str]" [arg-type]
+ isort/main.py:1082: error: Need type annotation for "file_names" [var-annotated]
+ isort/main.py:1282: error: Argument 1 to "join" of "str" has incompatible type "Any | Literal[True]"; expected "Iterable[str]" [arg-type]
+ isort/main.py:1288: error: Argument 1 to "join" of "str" has incompatible type "Any | Literal[True]"; expected "Iterable[str]" [arg-type]
zulip (https://github.com/zulip/zulip)
+ scripts/lib/zulip_tools.py:555: error: Need type annotation for "sudo_args" [var-annotated]
+ zproject/backends.py:1999: error: Need type annotation for "all_received_group_names" [var-annotated]
+ zerver/views/auth.py:956: error: Need type annotation for "extra_context" [var-annotated]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/indexers/objects.py:565: error: Argument 2 to "pop" of "dict" has incompatible type "int | BaseIndexer"; expected "int" [arg-type]
ibis (https://github.com/ibis-project/ibis)
+ ibis/backends/snowflake/__init__.py:262: error: Need type annotation for "session_parameters" [var-annotated]
+ ibis/backends/clickhouse/__init__.py:347: error: Need type annotation for "settings" [var-annotated]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/server/models/block_schemas.py:510: error: Need type annotation for "child_definitions" [var-annotated]
+ src/prefect/blocks/notifications.py:977: error: Need type annotation for "cookies" [var-annotated]
+ src/prefect/blocks/notifications.py:990: error: Need type annotation for "cookies" [var-annotated]
+ src/prefect/cli/deploy/_core.py:310: error: Argument 2 to "_gather_deployment_trigger_definitions" has incompatible type "Any | None"; expected "list[dict[str, Any]]" [arg-type]
pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/schema.py:1069: error: Argument "unique_items" to "conlist" has incompatible type "Any | None"; expected "bool" [arg-type]
+ pydantic/v1/decorator.py:181: error: Need type annotation for "var_kwargs" [var-annotated]
+ pydantic/deprecated/decorator.py:202: error: Need type annotation for "var_kwargs" [var-annotated]
strawberry (https://github.com/strawberry-graphql/strawberry)
+ strawberry/schema/schema.py:201: error: Argument 13 to "_OperationContextAwareGraphQLResolveInfo" has incompatible type "Any | None"; expected "dict[str, Any]" [arg-type]
cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/config/cc_ansible.py:277: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "str" [arg-type]
+ cloudinit/config/cc_ansible.py:278: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "list[str]" [arg-type]
meson (https://github.com/mesonbuild/meson)
+ docs/refman/loaderyaml.py:185:19: error: Need type annotation for "posargs" [var-annotated]
+ docs/refman/loaderyaml.py:186:19: error: Need type annotation for "optargs" [var-annotated]
+ docs/refman/loaderyaml.py:188:18: error: Need type annotation for "kwargs" [var-annotated]
+ docs/refman/loaderyaml.py:265:19: error: Need type annotation for "methods" [var-annotated]
altair (https://github.com/vega/altair)
+ tools/schemapi/codegen.py:273: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "str" [arg-type]
discord.py (https://github.com/Rapptz/discord.py)
- ...typeshed_to_test/stdlib/typing.pyi:1046: note: "update" of "TypedDict" defined here
+ ...typeshed_to_test/stdlib/typing.pyi:1044: note: "update" of "TypedDict" defined here
steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/commands/utils.py:52: note: def pop(self, str, _VT, /) -> _VT
- steam/ext/commands/utils.py:52: note: @overload
- steam/ext/commands/utils.py:52: note: @overload
- steam/ext/commands/utils.py:52: note: def pop(self, str, _VT, /) -> _VT
+ steam/state.py:454: error: Argument 2 to "pop" of "dict" has incompatible type "None"; expected "CMsgClientFriendsListFriend" [arg-type]
operator (https://github.com/canonical/operator)
- ops/_private/harness.py:2645: note: def pop(self, int, dict[str, Any], /) -> dict[str, Any]
cki-lib (https://gitlab.com/cki-project/cki-lib)
+ cki_lib/yaml.py:146: error: Argument 2 to "validate" has incompatible type "Any | None"; expected "dict[Any, Any] | list[Any] | str" [arg-type]
|
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.
#15297 (comment)