Skip to content

Type annotations for trio.open_file & trio.wrap_file #3390

@kinnay

Description

@kinnay

Hi,

I am currently adding type annotations to my projects. It seems that trio.open_file and trio.wrap_file returns an instance of the trio._file_io.AsyncIOWrapper. What puts me off a bit is the _file_io part, because names that begin with an underscore are usually meant to be private.

Is trio._file_io.AsyncIOWrapper the correct type annotation to use for the return value of trio.open_file? If so, does it not make sense to expose this type as part of Trio's public API, e.g. trio.AsyncIOWrapper, or perhaps trio.abc.AsyncIOWrapper?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions