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

Add possibility of using as decorator #142

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

podusowski
Copy link

@podusowski podusowski commented May 16, 2020

What do these changes do?

You can use timeout as function decorator.

Are there changes in behavior for the user?

Users get additional API

Related issue number

Fixes #141

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • 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.

@codecov
Copy link

codecov bot commented May 16, 2020

Codecov Report

Merging #142 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #142   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          105       110    +5     
  Branches        15        15           
=========================================
+ Hits           105       110    +5     
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 fd3c1eb...1dfe0d5. Read the comment docs.

Piotr Podusowski added 2 commits June 25, 2020 08:34
Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address my comments

async_timeout/__init__.py Outdated Show resolved Hide resolved
@@ -128,6 +128,13 @@ async def __aexit__(
self._do_exit(exc_type)
return None

def __call__(self, f):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A type hint is required

@CLAassistant

This comment has been minimized.

@podusowski podusowski marked this pull request as draft December 12, 2020 08:05
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.

It would be nice if timeout could be used as decorator
3 participants