Skip to content

TypeError: unsupported operand type(s) for |: 'PatternBase' and 'PatternBase' #189

@goncalossilva

Description

@goncalossilva

Hey, and thanks for this library! I have an issue declaring a union of different date/time format patterns.

This works:

MyDate = Union[DatePattern["%F"], DateTimePattern["%FT%T"], UTCDateTimePattern["%FT%TZ"]]

While this doesn't:

MyDate = DatePattern["%F"] | DateTimePattern["%FT%T"] | UTCDateTimePattern["%FT%TZ"]

I'm sticking with the former for now, even though the rest of the tooling doesn't really like it due to UP007.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions