Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@
"reportUnboundVariable": "error",
"reportInvalidStubStatement": "error",
"reportUnsupportedDunderAll": "error",
"reportInvalidTypeVarUse": "none",
"reportOverlappingOverload": "none",
"reportPropertyTypeMismatch": "none",
"reportSelfClsParameterName": "none"
"reportInvalidTypeVarUse": "error",
"reportPropertyTypeMismatch": "error",
"reportSelfClsParameterName": "error",
// Overloapping overloads cannot be enabled at this time because
// of the "factions.Fraction.__pow__" method and "tasks.gather" function.
// Mypy's overlapping overload logic misses these issues (see mypy
// issue #10143 and #10157).
"reportOverlappingOverload": "none"
}
3 changes: 2 additions & 1 deletion stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ class object:
__annotations__: Dict[str, Any]
@property
def __class__(self: _T) -> Type[_T]: ...
# Ignore errors about type mismatch between property getter and setter
@__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.

def __init__(self) -> None: ...
def __new__(cls) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
Expand Down
3 changes: 2 additions & 1 deletion stdlib/weakref.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):

class KeyedRef(ref[_T], Generic[_KT, _T]):
key: _KT
def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> KeyedRef[_KT, _T]: ...
# This __new__ method uses a non-standard name for the "cls" parameter
def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> KeyedRef[_KT, _T]: ... # type: ignore
def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ...

class WeakKeyDictionary(MutableMapping[_KT, _VT]):
Expand Down
2 changes: 1 addition & 1 deletion tests/pyright_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from pathlib import Path

_PYRIGHT_VERSION = "1.1.115"
_PYRIGHT_VERSION = "1.1.118"
_WELL_KNOWN_FILE = Path("tests", "pyright_test.py")


Expand Down