Skip to content

Conversation

@Avasam
Copy link
Collaborator

@Avasam Avasam commented Feb 29, 2024

#8280 removed some redundant #type: ignore, but not the associated comments.

__annotations__: dict[str, Any]
@property
def __class__(self) -> type[Self]: ...
# Ignore errors about type mismatch between property getter and setter
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed by @Akuli in #11496 (comment)
Added in #5092


class KeyedRef(ref[_T], Generic[_KT, _T]):
key: _KT
# This __new__ method uses a non-standard name for the "cls" parameter
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in #5092

@classmethod
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
if sys.version_info >= (3, 10):
# Yes, this is an instance method that has a parameter named "cls"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in #6443

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't feel strongly, but this one is kind of funny and might help a human who is quickly glancing at stubs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no issue leaving it in if you feel it has value outside of explaining a type: ignore comment

@github-actions

This comment has been minimized.

@classmethod
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
if sys.version_info >= (3, 10):
# Yes, this is an instance method that has a parameter named "cls"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't feel strongly, but this one is kind of funny and might help a human who is quickly glancing at stubs

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 2116158 into python:main Mar 1, 2024
danieleades pushed a commit to danieleades/typeshed that referenced this pull request Mar 1, 2024
@Avasam Avasam deleted the type-ignore-explanation-comments-not-removed branch March 1, 2024 23:41
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.

3 participants