Skip to content

typing.IO depends on the deprecated AnyStr type variable #142610

@SpecLad

Description

@SpecLad

Bug report

Bug description:

AnyStr is deprecated (#105578), but IO is still using it:

class IO(Generic[AnyStr]):

Seems like Python should follow its own advice here and replace it with [T: (str, bytes)].

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions