Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed May 3, 2024
1 parent f572723 commit 104a437
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pyoload has two main functions

annotate
========
Is used as a decorator on the function.
```python

from pyoload import annotate
Expand All @@ -20,3 +21,16 @@ def twice(a:int) -> int:

b = twice(4)
```
The annotate creates a wrapper over the decorated function which checks in for argument types over each function call using `pyoload.matchType(val, spec)`.
The original function is kept in the `.__pyod_annotate__` attribute.

overload
========
Implements function overloading in python via a simple decorator

```python
from pyoload import overload

@overload
def inverse(num:Values((0, 0.0)
```

0 comments on commit 104a437

Please sign in to comment.