Update arguments to parameters (Additional) [1]#20711
Conversation
This comment has been minimized.
This comment has been minimized.
arguments to parameters related to ARGUMENT_TYPE_EXPECTEDarguments to parameters related to ARGUMENT_TYPE_EXPECTED and MISSING_OR_INVALID_SELF_TYPE
mypy/message_registry.py
Outdated
| # Self-type | ||
| MISSING_OR_INVALID_SELF_TYPE: Final = ErrorMessage( | ||
| "Self argument missing for a non-static method (or an invalid type for self)" | ||
| "self parameter missing for a non-static method (or an invalid type for self)" |
There was a problem hiding this comment.
I also changed Self to self which is actually used as a parameter because It's more understandable:
class Cls: # ↓↓↓↓
def method(self) -> None: ...There was a problem hiding this comment.
It would be more consistent to use "self" parameter ... if using the lower-case version. I'd prefer it it was either quoted this way (we use double quotes) or unchanged from original, with capitalized 'Self'.
This comment has been minimized.
This comment has been minimized.
arguments to parameters related to ARGUMENT_TYPE_EXPECTED and MISSING_OR_INVALID_SELF_TYPEarguments to parameters (Additional) 1
arguments to parameters (Additional) 1arguments to parameters (Additional) [1]
This comment has been minimized.
This comment has been minimized.
JukkaL
left a comment
There was a problem hiding this comment.
Thanks, this makes the terminology more consistent. Mostly looks good.
mypy/message_registry.py
Outdated
| # Self-type | ||
| MISSING_OR_INVALID_SELF_TYPE: Final = ErrorMessage( | ||
| "Self argument missing for a non-static method (or an invalid type for self)" | ||
| "self parameter missing for a non-static method (or an invalid type for self)" |
There was a problem hiding this comment.
It would be more consistent to use "self" parameter ... if using the lower-case version. I'd prefer it it was either quoted this way (we use double quotes) or unchanged from original, with capitalized 'Self'.
|
Diff from mypy_primer, showing the effect of this PR on open source code: colour (https://github.com/colour-science/colour)
- colour/characterisation/aces_it.py:975: error: Ellipses cannot accompany other argument types in function type signature [syntax]
+ colour/characterisation/aces_it.py:975: error: Ellipses cannot accompany other parameter types in function type signature [syntax]
cki-lib (https://gitlab.com/cki-project/cki-lib)
- cki_lib/metrics/server.py:8: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/metrics/server.py:8: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/s3bucket.py:18: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/s3bucket.py:18: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/kcidb/validate.py:49: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/kcidb/validate.py:49: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/kcidb/validate.py:137: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/kcidb/validate.py:137: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/cki_pipeline.py:199: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/cki_pipeline.py:199: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:269: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:269: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:338: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:338: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:389: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:389: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:447: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:447: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- tests/kcidb/test_checks.py:193: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ tests/kcidb/test_checks.py:193: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- tests/kcidb/test_checks.py:207: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ tests/kcidb/test_checks.py:207: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
steam.py (https://github.com/Gobot1234/steam.py)
- steam/_const.py:73: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/_const.py:73: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:167: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:167: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:173: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:173: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:221: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:221: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:227: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:227: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
discord.py (https://github.com/Rapptz/discord.py)
- discord/client.py:1887: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ discord/client.py:1887: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
- discord/client.py:1897: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ discord/client.py:1897: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
pyodide (https://github.com/pyodide/pyodide)
- pyodide-build/pyodide_build/common.py:298: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:298: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/common.py:440: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:440: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/common.py:452: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:452: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/common.py:463: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:463: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/recipe/skeleton.py:237: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/recipe/skeleton.py:237: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/recipe/skeleton.py:246: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/recipe/skeleton.py:246: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/test_cli_xbuildenv.py:29: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/test_cli_xbuildenv.py:29: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/recipe/builder.py:781: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/recipe/builder.py:781: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:133: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:133: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:161: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:161: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/test_cli.py:299: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/test_cli.py:299: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
pandera (https://github.com/pandera-dev/pandera)
- tests/pandas/test_model.py:47: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ tests/pandas/test_model.py:47: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
- tests/pandas/test_model.py:52: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ tests/pandas/test_model.py:52: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
artigraph (https://github.com/artigraph/artigraph)
- src/arti/internal/models.py:146: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ src/arti/internal/models.py:146: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- src/arti/internal/models.py:150: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ src/arti/internal/models.py:150: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
pyppeteer (https://github.com/pyppeteer/pyppeteer)
- pyppeteer/launcher.py:222: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyppeteer/launcher.py:222: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
The word |
|
Is it? I guess because it says "should receive" instead of just talking about parameters? Alright (for ref): T = TypeVar('T')
def f() -> T: pass # E: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var] |
According to my understanding, the original error message above means:
Actually, the original error message itself is not good? So, should I change it to the new error messge which is simpler and more direct as shown below?:
With
|
|
IMO But as we've already established, I'm not so good with the specific terminology here so someone else should check that. |
JukkaL
left a comment
There was a problem hiding this comment.
Thanks for the updates! Let's merge this now, even if there may be other messages that could be updated -- they can be changed in a follow-up PR.
Fix: #20683
I changed
argumentstoparametersin the error messages of these constants below and I also changed some names of constants: