10 ms·
Python's optional arguments feature is useful for these kinds of polymorphic usages - and I miss them every time I program in other languages (especially Java).
by amix 17y ago
Python's optional arguments feature is useful for these kinds of polymorphic usages - and I miss them every time I program in other languages (especially Java). In JavaScript I miss named arguments (e.g. def fun(name, age, gender=1, height=None)), which is very useful especially if one calls stuff like Person("Bob", 13, height=150).
Generally, I don't think these kind of improvements are appreciated in C# as they are polymorphic and make it much harder for the compiler.
The optional arguments feature is to define a function like def fun(..., **kw)
- StrawberryFrog 17y agoC# 4 has exactly this feature.