Skip to content

Add typing integration#7

Open
enzo-santos wants to merge 4 commits into
siddheshsathe:masterfrom
enzo-santos:master
Open

Add typing integration#7
enzo-santos wants to merge 4 commits into
siddheshsathe:masterfrom
enzo-santos:master

Conversation

@enzo-santos
Copy link
Copy Markdown

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.

1 participant