Skip to content

Does the package can support the default params? #122

@rexwu1104

Description

@rexwu1104

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions