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

It doesn't work for single parameters #1

Open
ClimenteA opened this issue Aug 19, 2021 · 1 comment
Open

It doesn't work for single parameters #1

ClimenteA opened this issue Aug 19, 2021 · 1 comment

Comments

@ClimenteA
Copy link

Tried it with the code bellow:

@overload
def area(val:str) -> str:
    return "it's an str"

@overload
def area(val:int) -> str:
    return "it's an int"

print(area('3'))
print(area(7))

>> it's an str
>> it's an str
@Anonymusss12e
Copy link

The issue is that the overload decorator from the holo library is not recognized. This is because the holo library is not a standard Python library.

Here's what you need to do:

Install the holo library:

bash

Verify

Open In Editor
Edit
Copy code
pip install holo
Import the library:

python

Verify

Open In Editor
Edit
Copy code
from holo import overload
With these steps, your overloaded functions should work as intended.

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

No branches or pull requests

2 participants