Closed baterflyrity closed 9 months ago
Hi. Why would you need a hint for a single argument? As I see it, their primary purpose is to improve readability when you manage several arguments. When you have a single argument, the function name itself should serve as a hint.
Still, I will probably add a settings option for that in the next update.
Thanks a lot, it would be grateful.
Why would you need a hint for a single argument?
Because sometimes single argument is not the only one.
def decrease(step=1, start=2):
return start - step
decrease(3) # 3-- → -1 [wrong]
decrease(start=3) # 3-- → 2 [ok]
As you can see the function decrease
call is non-obvious here. Ofcourse, this signature is pretty ugly but some signatures can not be changed from user code.
We would think about adding support for such rare cases without breaking the old behavior
Thanks a lot, it would be grateful.
Why would you need a hint for a single argument?
Because sometimes single argument is not the only one.
def decrease(step=1, start=2): return start - step decrease(3) # 3-- → -1 [wrong] decrease(start=3) # 3-- → 2 [ok]
As you can see the function
decrease
call is non-obvious here. Ofcourse, this signature is pretty ugly but some signatures can not be changed from user code.
The sample provided by you would actually show the parameter hint, since there are 2 parameters defined in the function. The hints only omitted if:
Even so, I will add an option to the settings to show them even with a single parameter case, just to suit everyone's needs.
Hi!
Can please hint for single argument be added? As for now only 2+ arguments are hinted.