Skip to content

Commit 38453c0

Browse files
JelleZijlstragvanrossum
authored andcommitted
remove @builtinclass from stubs (#3392)
This appears to do nothing. My guess is that this is a feature from an old version of typing that managed to stick around in mypy.
1 parent 48c6425 commit 38453c0

File tree

9 files changed

+7
-25
lines changed

9 files changed

+7
-25
lines changed

test-data/unit/check-expressions.test

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,10 @@ class A:
932932
[builtins fixtures/list.pyi]
933933

934934
[case testNoneReturnTypeWithExpressions2]
935+
import typing
935936

936937
a, b = None, None # type: (A, bool)
937-
f() in a # Fail (see output)
938+
f() in a # E: "f" does not return a value # E: Unsupported right operand type for in ("A")
938939
a < f() # E: "f" does not return a value
939940
f() <= a # E: "f" does not return a value
940941
a in f() # E: "f" does not return a value
@@ -948,10 +949,6 @@ class A:
948949
def __add__(self, x: 'A') -> 'A':
949950
pass
950951
[builtins fixtures/bool.pyi]
951-
[out]
952-
main:3: error: "f" does not return a value
953-
main:3: error: Unsupported right operand type for in ("A")
954-
955952

956953
-- Slicing
957954
-- -------

test-data/unit/fixtures/bool.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# builtins stub used in boolean-related test cases.
22

3-
from typing import builtinclass
4-
5-
@builtinclass
63
class object:
74
def __init__(self) -> None: pass
85

test-data/unit/fixtures/function.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from typing import builtinclass
2-
3-
@builtinclass
41
class object:
52
def __init__(self): pass
63

test-data/unit/fixtures/isinstance.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import builtinclass, Tuple, TypeVar, Generic, Union
1+
from typing import Tuple, TypeVar, Generic, Union
22

33
T = TypeVar('T')
44

test-data/unit/fixtures/isinstancelist.pyi

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
from typing import builtinclass, Iterable, Iterator, TypeVar, List, Mapping, overload, Tuple, Set, Union
1+
from typing import Iterable, Iterator, TypeVar, List, Mapping, overload, Tuple, Set, Union
22

3-
@builtinclass
43
class object:
54
def __init__(self) -> None: pass
65

7-
@builtinclass
86
class type:
97
def __init__(self, x) -> None: pass
108

@@ -14,12 +12,9 @@ class function: pass
1412
def isinstance(x: object, t: Union[type, Tuple]) -> bool: pass
1513
def issubclass(x: object, t: Union[type, Tuple]) -> bool: pass
1614

17-
@builtinclass
1815
class int:
1916
def __add__(self, x: int) -> int: pass
20-
@builtinclass
2117
class bool(int): pass
22-
@builtinclass
2318
class str:
2419
def __add__(self, x: str) -> str: pass
2520
def __getitem__(self, x: int) -> str: pass

test-data/unit/fixtures/list.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Builtins stub used in list-related test cases.
22

3-
from typing import TypeVar, Generic, builtinclass, Iterable, Iterator, overload
3+
from typing import TypeVar, Generic, Iterable, Iterator, overload
44

55
T = TypeVar('T')
66

7-
@builtinclass
87
class object:
98
def __init__(self): pass
109

test-data/unit/fixtures/ops.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
from typing import builtinclass, overload, Any, Generic, Sequence, Tuple, TypeVar
1+
from typing import overload, Any, Generic, Sequence, Tuple, TypeVar
22

33
Tco = TypeVar('Tco', covariant=True)
44

55
# This is an extension of transform builtins with additional operations.
66

7-
@builtinclass
87
class object:
98
def __init__(self) -> None: pass
109
def __eq__(self, o: 'object') -> 'bool': pass

test-data/unit/fixtures/type.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# builtins stub used in type-related test cases.
22

3-
from typing import builtinclass, Generic, TypeVar, List
3+
from typing import Generic, TypeVar, List
44

55
T = TypeVar('T')
66

7-
@builtinclass
87
class object:
98
def __init__(self) -> None: pass
109
def __str__(self) -> 'str': pass

test-data/unit/lib-stub/typing.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ TypeVar = 0
1414
Generic = 0
1515
Tuple = 0
1616
Callable = 0
17-
builtinclass = 0
1817
_promote = 0
1918
NamedTuple = 0
2019
Type = 0

0 commit comments

Comments
 (0)