You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/classdefs.pyi
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
importabc
2
+
importbuiltins
2
3
importcollections.abc
3
4
importtyping
4
5
fromabcimportabstractmethod
@@ -11,7 +12,7 @@ from typing_extensions import final
11
12
classBad:
12
13
def__new__(cls, *args: Any, **kwargs: Any) ->Bad: ... # Y034 "__new__" methods usually return "self" at runtime. Consider using "_typeshed.Self" in "Bad.__new__", e.g. "def __new__(cls: type[Self], *args: Any, **kwargs: Any) -> Self: ..."
13
14
def__repr__(self) ->str: ... # Y029 Defining __repr__ or __str__ in a stub is almost always redundant
14
-
def__str__(self) ->str: ... # Y029 Defining __repr__ or __str__ in a stub is almost always redundant
15
+
def__str__(self) ->builtins.str: ... # Y029 Defining __repr__ or __str__ in a stub is almost always redundant
15
16
def__eq__(self, other: Any) ->bool: ... # Y032 Prefer "object" to "Any" for the second parameter in "__eq__" methods
16
17
def__ne__(self, other: typing.Any) ->typing.Any: ... # Y032 Prefer "object" to "Any" for the second parameter in "__ne__" methods
17
18
def__enter__(self) ->Bad: ... # Y034 "__enter__" methods in classes like "Bad" usually return "self" at runtime. Consider using "_typeshed.Self" in "Bad.__enter__", e.g. "def __enter__(self: Self) -> Self: ..."
0 commit comments