Skip to content

Commit 67925f2

Browse files
emmatypingilevkivskyi
authored andcommitted
Remove dead code (#6167)
1 parent 9edc38d commit 67925f2

File tree

5 files changed

+0
-51
lines changed

5 files changed

+0
-51
lines changed

mypy/main.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,6 @@ def flush_errors(new_messages: List[str], serious: bool) -> None:
123123
sys.exit(code)
124124

125125

126-
def readlinkabs(link: str) -> str:
127-
"""Return an absolute path to symbolic link destination."""
128-
# Adapted from code by Greg Smith.
129-
assert os.path.islink(link)
130-
path = os.readlink(link)
131-
if os.path.isabs(path):
132-
return path
133-
return os.path.join(os.path.dirname(link), path)
134-
135-
136126
class SplitNamespace(argparse.Namespace):
137127
def __init__(self, standard_namespace: object, alt_namespace: object, alt_prefix: str) -> None:
138128
self.__dict__['_standard_namespace'] = standard_namespace

mypy/messages.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
TUPLE_INDEX_OUT_OF_RANGE = 'Tuple index out of range' # type: Final
7676
INVALID_SLICE_INDEX = 'Slice index must be an integer or None' # type: Final
7777
CANNOT_INFER_LAMBDA_TYPE = 'Cannot infer type of lambda' # type: Final
78-
CANNOT_INFER_ITEM_TYPE = 'Cannot infer iterable item type' # type: Final
7978
CANNOT_ACCESS_INIT = 'Cannot access "__init__" directly' # type: Final
8079
CANNOT_ASSIGN_TO_METHOD = 'Cannot assign to a method' # type: Final
8180
CANNOT_ASSIGN_TO_TYPE = 'Cannot assign to a type' # type: Final
@@ -1113,12 +1112,6 @@ def overloaded_signatures_overlap(self, index1: int, index2: int, context: Conte
11131112
self.fail('Overloaded function signatures {} and {} overlap with '
11141113
'incompatible return types'.format(index1, index2), context)
11151114

1116-
def overloaded_signatures_partial_overlap(self, index1: int, index2: int,
1117-
context: Context) -> None:
1118-
self.fail('Overloaded function signatures {} and {} '.format(index1, index2)
1119-
+ 'are partially overlapping: the two signatures may return '
1120-
+ 'incompatible types given certain calls', context)
1121-
11221115
def overloaded_signature_will_never_match(self, index1: int, index2: int,
11231116
context: Context) -> None:
11241117
self.fail(

mypy/server/objgraph.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,6 @@ def get_reachable_graph(root: object) -> Tuple[Dict[int, object],
105105
return seen, parents
106106

107107

108-
def find_all_reachable(root: object) -> List[object]:
109-
return list(get_reachable_graph(root)[0].values())
110-
111-
112-
def aggregate_by_type(objs: List[object]) -> Dict[type, List[object]]:
113-
m = {} # type: Dict[type, List[object]]
114-
for o in objs:
115-
m.setdefault(type(o), []).append(o)
116-
return m
117-
118-
119108
def get_path(o: object,
120109
seen: Dict[int, object],
121110
parents: Dict[int, Tuple[int, object]]) -> List[Tuple[object, object]]:

mypy/types.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,6 @@ def __init__(self, line: int = -1, column: int = -1) -> None:
752752
@abstractmethod
753753
def is_type_obj(self) -> bool: pass
754754

755-
def is_concrete_type_obj(self) -> bool:
756-
return self.is_type_obj()
757-
758755
@abstractmethod
759756
def type_object(self) -> mypy.nodes.TypeInfo: pass
760757

@@ -938,12 +935,6 @@ def with_name(self, name: str) -> 'CallableType':
938935
def get_name(self) -> Optional[str]:
939936
return self.name
940937

941-
def max_fixed_args(self) -> int:
942-
n = len(self.arg_types)
943-
if self.is_var_arg:
944-
n -= 1
945-
return n
946-
947938
def max_possible_positional_args(self) -> int:
948939
"""Returns maximum number of positional arguments this method could possibly accept.
949940
@@ -2186,12 +2177,6 @@ def is_generic_instance(tp: Type) -> bool:
21862177
return isinstance(tp, Instance) and bool(tp.args)
21872178

21882179

2189-
def is_invariant_instance(tp: Type) -> bool:
2190-
if not isinstance(tp, Instance) or not tp.args:
2191-
return False
2192-
return any(v.variance == INVARIANT for v in tp.type.defn.type_vars)
2193-
2194-
21952180
def is_optional(t: Type) -> bool:
21962181
return isinstance(t, UnionType) and any(isinstance(e, NoneTyp) for e in t.items)
21972182

mypy/util.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ def short_type(obj: object) -> str:
4646
return t.split('.')[-1].rstrip("'>")
4747

4848

49-
def array_repr(a: List[T]) -> List[str]:
50-
"""Return the items of an array converted to strings using Repr."""
51-
aa = [] # type: List[str]
52-
for x in a:
53-
aa.append(repr(x))
54-
return aa
55-
56-
5749
def find_python_encoding(text: bytes, pyversion: Tuple[int, int]) -> Tuple[str, int]:
5850
"""PEP-263 for detecting Python file encoding"""
5951
result = ENCODING_RE.match(text)

0 commit comments

Comments
 (0)