MCPcopy Index your code
hub / github.com/RustPython/RustPython / _flatten_literal_params

Function _flatten_literal_params

Lib/typing.py:365–373  ·  view source on GitHub ↗

Internal helper for Literal creation: flatten Literals among parameters.

(parameters)

Source from the content-addressed store, hash-verified

363 return new_unhashable
364
365def _flatten_literal_params(parameters):
366 """Internal helper for Literal creation: flatten Literals among parameters."""
367 params = []
368 for p in parameters:
369 if isinstance(p, _LiteralGenericAlias):
370 params.extend(p.__args__)
371 else:
372 params.append(p)
373 return tuple(params)
374
375
376_cleanups = []

Callers 1

LiteralFunction · 0.85

Calls 3

isinstanceFunction · 0.85
extendMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected