Replies: 3 comments
-
|
I'm seconding this, as the lack of this feature resulted in quite a bit of duplicate code in my iceberg code implementation. |
Beta Was this translation helpful? Give feedback.
-
|
Default values would be really useful. Please consider this again. |
Beta Was this translation helpful? Give feedback.
-
|
Agreed that would be useful. One question is how to deal with higher-order function values: def foo(x: int): ...
def bar(x: int): ...
def baz(y: int): ...
def faz(x: int, y: int = 10): ...
def main(b: bool):
f = foo if b else bar
f(x=42) # Allow kwarg here?
g = foo if b else baz # Do these unify if the argument names are different?
h = foo if b else faz # What about these?An easy solution would be to say "no, yes, no" to the above and just allow kwargs and omitting defaults when calling function directly. Would this be too restrictive? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Just like in python! This may give us a useful hack to do some faux overloading, seems like a win
Beta Was this translation helpful? Give feedback.
All reactions