Skip to content

Variable positional arguments #116

Answered by coady
sylvorg asked this question in Q&A
Discussion options

You must be logged in to vote

multimethod supports variable arguments, but there are no types in the example. The pythonic way to do this kind of "overloading" is to use defaults.

def call(name="world"):
    print(f"Hello, {name}!")

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by coady
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #115 on March 01, 2024 02:59.