Re:What's Coming in Python 3.8
by Razengan on Wednesday July 17, 2019 @10:26PM
(#20466156)
The '*' and '/' in function parameter lists for positional/keyword arguments look particularly ugly and unintuitive to me. More magic symbols to memorize or look up.
[ Parent
| on HN ]
I also cannot honestly think of a case where I want that behaviour.
The "pow" example looks more like a case where the C side should be fixed.
> I also cannot honestly think of a case where I want that behaviour.
There's plenty of situations where a named argument does not help, and encoding it can only hurt. It makes little to no sense to name the first argument to `dict.update` for instance. Or the argument to `ord`.
That, incidentally, is why Swift added support for positional-only parameters (though it has no concept of keyword-or-positional).
> That, incidentally, is why Swift added support for positional-only parameters (though it has no concept of keyword-or-positional).
Swift's syntax is a lot more intuitive and consistent:
function(parameterWithImplicitlyRequiredLabel: Int,
differentArgumentLabel internalParameterName: Int,
_ parameterWithoutLabel: Int,
variadicParameterWithLabel: Int...)
which you would call as function(parameterWithImplicitlyRequiredLabel: 1, differentArgumentLabel: 2, 3, variadicParameterWithLabel: 4, 5, 6, 7)
[0] https://docs.swift.org/swift-book/LanguageGuide/Functions.ht...It does not help but doesn't hurt enough to grant a special syntax to avoid it.
Yes, it limits your ability to rename a local variable, but that seems minor.