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

Does the package can support the default params? #122

Open
rexwu1104 opened this issue Mar 18, 2022 · 1 comment
Open

Does the package can support the default params? #122

rexwu1104 opened this issue Mar 18, 2022 · 1 comment

Comments

@rexwu1104
Copy link

I put a default param in the function, but I cannot let param to be optional, I must to write two same function.

class Foo(object):

  @dispatch(str)
  def __init__(bar: str, baz: bool = True):
    print(bar, baz)

  @dispatch(str, bool)
  def __init__(bar: str, baz: bool = True):
    print(bar, baz)

this is my solution

@botkero
Copy link

botkero commented Jul 25, 2023

I would also be interested to know how to define default values

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