expression form of one-to-many dict?
Mike Meyer
mwm at mired.org
Sun Dec 19 15:08:27 EST 2004
Nick Craig-Wood <nick at craig-wood.com> writes:
> It would be nice if setdefault didn't evaluate the second argument
> unless it needed it. However I guess it would have to be a language
> feature to do that.
Personally, I'd love a language feature that let you create a function
that didn't evaluate arguments until they were actually used - lazy
evaluation. That lets you write the C ?: operator as a function, for
a start.
Hmmm. No, iterators can't be used to fake it. Oh well.
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
More information about the Python-list
mailing list