python-trio / python-trio/trio
Type annotations for `trio.open_file` & `trio.wrap_file`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.3k
- Forks
- 431
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 6
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the return types of trio.open_file and trio.wrap_file, focusing on trio._file_io.AsyncIOWrapper and the proposed trio.AsyncIOWrapper or trio.abc.AsyncIOWrapper locations. Done means the public type-annotation choice is resolved and the relevant API surface is updated or explicitly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100