Skip to content

Move away from PEP604 - use of | for isinstance/issubclass #14633

@hoxbro

Description

@hoxbro

Problem description

The Ruff rule, which enforced this change, has been removed in the latest version, as it is slower than a tuple. We should therefore revert | back into tuples.

docs.astral.sh/ruff/rules/non-pep604-isinstance

An example of this is here:

return isinstance(value, FunctionType | InstanceDefault)

Feature description

Potential alternatives

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions