Skip to content

Commit bbb347c

Browse files
committed
chore: Prepare API for expression modernization
1 parent 82a9d57 commit bbb347c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/griffe/expressions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ def iterate(self, *, flat: bool = True) -> Iterator[str | Expr]: # noqa: ARG002
108108
"""
109109
yield from ()
110110

111+
def modernize(self) -> Expr:
112+
"""Modernize the expression.
113+
114+
For example, use PEP 604 type unions `|` instead of `typing.Union`.
115+
116+
Returns:
117+
A modernized expression.
118+
"""
119+
return self
120+
111121
def as_dict(self, **kwargs: Any) -> dict[str, Any]:
112122
"""Return the expression as a dictionary.
113123

0 commit comments

Comments
 (0)