4 ms·
Frankly I'm a bit torn on this one as f(x=x) is indeed a common pattern and having just f(x=) reduces the need for multiline invocations but I feel like adding
by belval 3y ago
Frankly I'm a bit torn on this one as f(x=x) is indeed a common pattern and having just f(x=) reduces the need for multiline invocations but I feel like adding syntatic sugar to python at this point is just giving the snake diabetes.
- stefanos82 3y ago> ...but I feel like adding syntactic sugar to python at this point is just giving the snake diabetes. Haha! :D nice one! Personally I would prefer if they chose the `f(:x)` syntax, because it reminds me of how Ruby uses symbols to represent instance variables.
- SushiHippie 3y agoThey mention this on in "Prior Art" https://peps.python.org/pep-0736/#prior-art https://peps.python.org/pep-0736/#prior-art And it just makes sense to do it this way as a) it is basically the same as in ruby, except that the long form in ruby uses a colon and python uses an equals sign b) this syntax already exists in python for f-strings But I agree x= looks a bit "unfinished" and erroneous while :x does not IMO, though I'm looking forward to do fewer keypresses if this gets released.