Expose AsyncIOWrapper for public file type annotations - #3507
Closed
vzer200 wants to merge 1 commit into
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3507 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 128 128
Lines 19454 19459 +5
Branches 1321 1323 +2
===============================================
+ Hits 19454 19459 +5
🚀 New features to boost your workflow:
|
Contributor
|
I'm not willing to waste my time going through the issues with this PR (I think the testing strategy is wrong w/r/t handling missing attributes and probably this would need a mention in the docs?), given you have a bunch of open PRs + the PR explanation is LLM-generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose the existing generic file-wrapper type as
trio.AsyncIOWrapper, so callers can annotate values returned byopen_file(),wrap_file()andPath.open()without importing a private module.Fixes #3390 and follows the discussion on the closed #2864. The class follows Trio's final-class convention. The documentation describes its wrapped-file type parameter, and runtime/type tests now use the public import. Static class inspection accounts specifically for its existing dynamically supplied methods and properties; unexpected differences still fail the checks.
Validation:
AI-assisted implementation, independently reviewed by other coding agents.