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 typing integration #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

enzo-santos
Copy link

This PR adds integration with the typing module, specifically the specifications proposed by PEP 612.

This PR also makes some decorators to return the value returned by the wrapped function (such as trycatch and timer), so you can use them such as

import decorators

@decorators.timer
def calculate(foo: int) -> int:
    return foo + 42

print(calculate(21))    # Previous version: prints None
                        # Current version: prints 63

The code is checked by mypy and is also formatted by black.

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

1 participant