4 ms·
> datetime.date(2018, 3, 4) > datetime.date(2018)(3)(4) It's very obvious that the first of these date() function must be a function of three arguments (year
by HelloNurse 4y ago
> datetime.date(2018, 3, 4)
> datetime.date(2018)(3)(4)
It's very obvious that the first of these date() function must be a function of three arguments (year, month, day) and the second, if the two calls are meant to return the same result, must be a function of one argument (year) that returns a function of one argument (month) that returns a function of one argument (day) that returns, presumably, a date.
Syntactic sugar to call one date() as if it was the completely different other one would be recklessly dangerous. In particular, there are default parameters: date(1848) might legitimately mean something like 1/1/1848 (defaulting day and month to 1 and 1), not "give me a curried factory of dates in 1848".