Skip to content

Conversation

@erictraut
Copy link
Contributor

Enable all but one of pyright's strictest checks. Add a "# type: ignore" to __new__ method in weakref.KeyRef because it uses a non-standard name for the cls parameter, which is flagged as an error by pyright.

…. Enable all but one of pyright's strictest checks. Add a "# type: ignore" to `__new__` method in `weakref.KeyRef` because it uses a non-standard name for the `cls` parameter, which is flagged as an error by pyright.
def __class__(self: _T) -> Type[_T]: ...
@__class__.setter
def __class__(self, __type: Type[object]) -> None: ... # noqa: F811
def __class__(self, __type: Type[object]) -> None: ... # type: ignore # noqa: F811
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to add a comment explaining what is being ignored here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can do that. There didn't seem to be a precedent for this, which is why I initially left it out.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I think it's helpful in the future for documenting why we have these type ignores.

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