formate.reformat_generics¶
Formats generics (List[...], Union[...] etc.) at the module and class level.
Example output, with a line length of 100:
ParamsMappingValueType = Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]
Data = Union[None, str, bytes, MutableMapping[str, Any], Iterable[Tuple[str, Optional[str]]], IO]
ParamsType = Union[
Mapping[Union[str, bytes, int, float], ParamsMappingValueType],
Union[str, bytes],
Tuple[Union[str, bytes, int, float], ParamsMappingValueType],
None
]
Functions:
|
Reformats generics ( |
Classes:
|
Represents a |
|
Represents a list of elements, most often used within a |
-
reformat_generics(source, formate_global_config=None, **kwargs)[source]¶ Reformats generics (
typing.Generic,typing.Union,typing.Callableetc.) in the given source, and returns the reformatted source.
-
class
Generic(name, elements)[source]¶ Bases:
objectRepresents a
typing.Generic,typing.Union,typing.Callableetc.- Parameters
Methods: