diff --git a/src/basedtyping/transformer.py b/src/basedtyping/transformer.py index 292eb84..82887b1 100644 --- a/src/basedtyping/transformer.py +++ b/src/basedtyping/transformer.py @@ -230,11 +230,9 @@ def eval_type_based( *, string_literals: bool, ) -> object: - """ - Like `typing._eval_type`, but lets older Python versions use newer typing features. - Specifically, this transforms `X | Y` into `typing.Union[X, Y]` - and `list[X]` into `typing.List[X]` etc. (for all the types made generic in PEP 585) - if the original syntax is not supported in the current Python version. + """Like `typing._eval_type`, but supports based typing features. + Specifically, this transforms `1 | 2` into `typing.Union[Literal[1], Literal[2]]` + and `(int) -> str` into `typing.Callable[[int], str]` etc. """ tree: ast.AST try: