MCPcopy Create free account
hub / github.com/python/mypy / remove_dups

Function remove_dups

mypy/types.py:4275–4285  ·  view source on GitHub ↗
(types: list[T])

Source from the content-addressed store, hash-verified

4273
4274
4275def remove_dups(types: list[T]) -> list[T]:
4276 if len(types) <= 1:
4277 return types
4278 # Get unique elements in order of appearance
4279 all_types: set[T] = set()
4280 new_types: list[T] = []
4281 for t in types:
4282 if t not in all_types:
4283 new_types.append(t)
4284 all_types.add(t)
4285 return new_types
4286
4287
4288def type_vars_as_args(type_vars: Sequence[TypeVarLikeType]) -> tuple[Type, ...]:

Calls 4

lenFunction · 0.85
setClass · 0.85
appendMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…