expression form of one-to-many dict?
Paul Rubin
http
Mon Dec 20 23:59:30 EST 2004
More information about the Python-list mailing list
Mon Dec 20 23:59:30 EST 2004
- Previous message (by thread): expression form of one-to-many dict?
- Next message (by thread): Lazy argument evaluation (was Re: expression form of one-to-many dict?)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mike Meyer <mwm at mired.org> writes: > 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. You can fake it with lambda, but the syntax is contorted. a = condition ? expr1 : expr2; becomes a = ((lambda: expr2, lambda: expr1)[bool(condition)])()
- Previous message (by thread): expression form of one-to-many dict?
- Next message (by thread): Lazy argument evaluation (was Re: expression form of one-to-many dict?)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list