Skip to content

Commit f44a60d

Browse files
authored
Remove support for builtins.Any (#18578)
While doing some cleanup, I noticed a reference to `builtins.Any`. To the best of my knowledge, it was never implemented.
1 parent 23e2d0f commit f44a60d

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

mypy/typeanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def try_analyze_special_unbound_type(self, t: UnboundType, fullname: str) -> Typ
616616
"""
617617
if fullname == "builtins.None":
618618
return NoneType()
619-
elif fullname == "typing.Any" or fullname == "builtins.Any":
619+
elif fullname == "typing.Any":
620620
return AnyType(TypeOfAny.explicit, line=t.line, column=t.column)
621621
elif fullname in FINAL_TYPE_NAMES:
622622
if self.prohibit_special_class_field_types:

test-data/unit/check-ctypes.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ cua.raw # E: Array attribute "raw" is only available with element type "c_char"
138138

139139
[case testCtypesAnyArrayAttrs]
140140
import ctypes
141+
from typing import Any
141142

142143
aa: ctypes.Array[Any]
143144
reveal_type(aa.value) # N: Revealed type is "Any"

test-data/unit/fixtures/float.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from typing import Generic, TypeVar
1+
from typing import Generic, TypeVar, Any
22
T = TypeVar('T')
33

4-
Any = 0
5-
64
class object:
75
def __init__(self) -> None: pass
86

test-data/unit/fixtures/floatdict.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
from typing import TypeVar, Generic, Iterable, Iterator, Mapping, Tuple, overload, Optional, Union
1+
from typing import TypeVar, Generic, Iterable, Iterator, Mapping, Tuple, overload, Optional, Union, Any
22

33
T = TypeVar('T')
44
KT = TypeVar('KT')
55
VT = TypeVar('VT')
66

7-
Any = 0
8-
97
class object:
108
def __init__(self) -> None: pass
119

0 commit comments

Comments
 (0)