Skip to content

Replace "self argument" with "self parameter"#20992

Closed
hyperkai wants to merge 2 commits intopython:masterfrom
hyperkai:hyperkai-patch-11
Closed

Replace "self argument" with "self parameter"#20992
hyperkai wants to merge 2 commits intopython:masterfrom
hyperkai:hyperkai-patch-11

Conversation

@hyperkai
Copy link
Contributor

@hyperkai hyperkai commented Mar 9, 2026

Fix: #20993

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

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

pydantic (https://github.com/pydantic/pydantic)
- pydantic/main.py:1254: error: Invalid self argument "BaseModel" to attribute function "__repr_name__" with type "Callable[[Representation], str]"  [misc]
+ pydantic/main.py:1254: error: Invalid self parameter "BaseModel" to attribute function "__repr_name__" with type "Callable[[Representation], str]"  [misc]
- pydantic/main.py:1254: error: Invalid self argument "BaseModel" to attribute function "__repr_str__" with type "Callable[[Representation, str], str]"  [misc]
+ pydantic/main.py:1254: error: Invalid self parameter "BaseModel" to attribute function "__repr_str__" with type "Callable[[Representation, str], str]"  [misc]
- pydantic/main.py:1292: error: Invalid self argument "BaseModel" to attribute function "__repr_str__" with type "Callable[[Representation, str], str]"  [misc]
+ pydantic/main.py:1292: error: Invalid self parameter "BaseModel" to attribute function "__repr_str__" with type "Callable[[Representation, str], str]"  [misc]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/manifest.py:517: error: Invalid self argument "ManifestPath" to attribute function "read_bytes" with type "def read(self: _IOMixinNoOpen, **kwargs: Any) -> Coroutine[Any, Any, bytes]"  [misc]
+ steam/manifest.py:517: error: Invalid self parameter "ManifestPath" to attribute function "read_bytes" with type "def read(self: _IOMixinNoOpen, **kwargs: Any) -> Coroutine[Any, Any, bytes]"  [misc]
- steam/client.py:1279: error: Invalid self argument "type[TradeOffer[ReceivingAssetT, SendingAssetT, UserT]]" to attribute function "_from_history" with type "Callable[[type[TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]], ConnectionState, TradeOfferHistoryTrade, Sequence[Description]], TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]]"  [misc]
+ steam/client.py:1279: error: Invalid self parameter "type[TradeOffer[ReceivingAssetT, SendingAssetT, UserT]]" to attribute function "_from_history" with type "Callable[[type[TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]], ConnectionState, TradeOfferHistoryTrade, Sequence[Description]], TradeOffer[MovedItem[UserT], MovedItem[ClientUser], UserT]]"  [misc]

apprise (https://github.com/caronc/apprise)
- apprise/persistent_store.py:154: error: Attribute function "hash_engine" with type "def openssl_sha256(data: Buffer = ..., *, usedforsecurity: bool = ..., string: Buffer | None = ...) -> HASH" does not accept self argument  [misc]
+ apprise/persistent_store.py:154: error: Attribute function "hash_engine" with type "def openssl_sha256(data: Buffer = ..., *, usedforsecurity: bool = ..., string: Buffer | None = ...) -> HASH" does not accept self parameter  [misc]

@hauntsaninja
Copy link
Collaborator

This one is an argument

@hyperkai
Copy link
Contributor Author

This one is an argument

Some should keep self argument? instead of self parameter? OK, I'll check them again.

@hyperkai
Copy link
Contributor Author

This one is an argument

At least most should keep self argument. Sorry for that.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The phrase "self argument" wrongly used 47 times in mypy should be replaced with "self parameter"

2 participants