◐ Shell
clean mode source ↗

support | operation between typing.Union and strings by elmjag · Pull Request #6983 · RustPython/RustPython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

coderabbitai[bot]

youknowone

Comment on lines +240 to +245

Elmir Jagudin added 2 commits

February 4, 2026 12:57
Move _call_typing_func_object() code to
stdlib::typing::call_typing_func_object().
Use that function everywhere.
Adds support for performing '|' operation between Union objects and
strings, e.g. forward type references.

For example following code:

    from typing import Union

    U1 = Union[int, str]
    U1 | "float"

The result of the operation above becomes:

   int | str | ForwardRef('float')

youknowone