4 ms·
PEP-671 – Syntax for late-bound function argument defaults
- karmakaze 5y agoI've always wanted this solved uniformly for values and functions that return them. Say we have a type definition of an argument as T, then any call site could instead pass in a function that returns T in its place. Then this late-bind default would be an expression for a function returning T where T is the argument type. I would also like this to be extended to only evaluate once if at all.