File tree Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ A().f = None # E: Cannot assign to a method
122
122
[case testReferToInvalidAttribute]
123
123
124
124
class A:
125
- def __init__(self):
125
+ def __init__(self) -> None :
126
126
self.x = object()
127
127
a = None # type: A
128
128
a.y
Original file line number Diff line number Diff line change @@ -1403,7 +1403,7 @@ b[{}] = 1
1403
1403
1404
1404
[case testInferDictInitializedToEmptyAndUpdatedFromMethod]
1405
1405
map = {}
1406
- def add():
1406
+ def add() -> None :
1407
1407
map[1] = 2
1408
1408
[builtins fixtures/dict.pyi]
1409
1409
[out]
@@ -1959,7 +1959,7 @@ class C:
1959
1959
1960
1960
if bool():
1961
1961
f()
1962
- 1 + '' # E: Unsupported left operand type for + ("int")
1962
+ 1 + '' # E: Unsupported operand types for + ("int" and "str ")
1963
1963
[builtins fixtures/list.pyi]
1964
1964
[out]
1965
1965
@@ -1976,7 +1976,7 @@ class C:
1976
1976
1977
1977
if bool():
1978
1978
f()
1979
- 1 + '' # E: Unsupported left operand type for + ("int")
1979
+ 1 + '' # E: Unsupported operand types for + ("int" and "str ")
1980
1980
[builtins fixtures/list.pyi]
1981
1981
[out]
1982
1982
@@ -1992,6 +1992,6 @@ class C:
1992
1992
1993
1993
if bool():
1994
1994
f([])
1995
- 1 + '' # E: Unsupported left operand type for + ("int")
1995
+ 1 + '' # E: Unsupported operand types for + ("int" and "str ")
1996
1996
[builtins fixtures/list.pyi]
1997
1997
[out]
Original file line number Diff line number Diff line change @@ -1312,7 +1312,7 @@ class A:
1312
1312
def f(self) -> str: return 'foo'
1313
1313
class B(A):
1314
1314
def f(self) -> str: return self.x
1315
- def initialize(self): self.x = 'bar'
1315
+ def initialize(self) -> None : self.x = 'bar'
1316
1316
[out]
1317
1317
1318
1318
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ a @= 1 # E: Argument 1 to "__imatmul__" of "A" has incompatible type "int"; exp
353
353
354
354
[case testInplaceSetitem]
355
355
class A(object):
356
- def __init__(self):
356
+ def __init__(self) -> None :
357
357
self.a = 0
358
358
359
359
def __iadd__(self, a):
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class list(Generic[T]):
26
26
27
27
class tuple (Generic [T ]): pass
28
28
class function : pass
29
- class int : pass
29
+ class int :
30
+ def __add__ (self , other : 'int' ) -> 'int' : pass
30
31
class float : pass
31
32
class str : pass
32
33
class bool (int ): pass
You can’t perform that action at this time.
0 commit comments