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 104a437 commit 32c8220
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ Implements function overloading in python via a simple decorator

```python
from pyoload import overload
import math
cache = {}

tan_is_real = lambda v: not (v + 90) % 180 == 0

@overload
def tan(num:Validator(tan_is_real, opposite=True)):
raise ValueError(num)

@overload
def inverse(num:Values((0, 0.0)
def tan(num:int|float) -> float:
return math.tan(num(

tan(6)
```

0 comments on commit 32c8220

Please sign in to comment.