Skip to content

Support PEP 604 syntax for runtime use cases #9880

Closed
@hauntsaninja

Description

@hauntsaninja

This is a follow up to #9610.

Most of PEP 604 support is available, however we're missing support for isinstance(x, int | str) (and more generally, runtime uses of __or__ on types). This will require a typeshed change, but I'm filing here so that we make sure it works. Even if all it takes is a typeshed change, at the very least we should add a test.

(For people who stumble upon this thread, this is only relevant for Python 3.10 and greater)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions