PEP 308: A PEP Writer's Experience
holger krekel
pyth at devel.trillke.net
Mon Feb 10 18:53:24 EST 2003
More information about the Python-list mailing list
Mon Feb 10 18:53:24 EST 2003
- Previous message (by thread): PEP 308: A PEP Writer's Experience - PRO
- Next message (by thread): PEP 308: A PEP Writer's Experience - PRO
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
David Eppstein wrote: > In article <mailman.1044904883.10775.python-list at python.org>, > holger krekel <pyth at devel.trillke.net> wrote: > > > People using the ternary-op may easily fail to realize > > that the idiom isn't the right one all the time. For example, > > it might prevent people from learning about the specific pythonic > > behaviour of and/or returning the "short-circuiting" object. > > Subsequently > > > > result = hasattr(obj, 'method') and obj.method() > > > > is not obvious to them but > > > > result = obj.method() if hasatttr(obj, 'method') else None > > > > is > > I fail to see why forcing people to avoid an idiom that's obvious to > them (because it's not the "right" one) is a benefit to their > productivity or the readability of their code. because it easily leads to if obj.method() if hasattr(obj, 'method') else None: which you have a harder time to justify as nice, not? holger
- Previous message (by thread): PEP 308: A PEP Writer's Experience - PRO
- Next message (by thread): PEP 308: A PEP Writer's Experience - PRO
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list