Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annotations on __exit__ and __aexit__ #274

Merged
merged 3 commits into from
Dec 19, 2021

Conversation

JelleZijlstra
Copy link
Contributor

All parameters should be Optional, because they're None when no exception is thrown.

What do these changes do?

Change some type annotations.

Are there changes in behavior for the user?

Potentially if they are using a type checker. I found this because I made pyanalyze reject with statements using objects that do not meet the ContextManager protocol. Other type checkers may be less strict.

Related issue number

None.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist (not needed)
  • Documentation reflects the changes (not needed)
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

All parameters should be Optional, because they're None when no exception is thrown.
@JelleZijlstra
Copy link
Contributor Author

I'll add a changelog entry in a minute.

@codecov
Copy link

codecov bot commented Dec 19, 2021

Codecov Report

Merging #274 (a5b0a6f) into master (8685c60) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #274   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          118       118           
  Branches        20        20           
=========================================
  Hits           118       118           
Flag Coverage Δ
unit 97.45% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
async_timeout/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8685c60...a5b0a6f. Read the comment docs.

@Dreamsorcerer Dreamsorcerer merged commit 2ede7d7 into aio-libs:master Dec 19, 2021
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants