hasattr() or "x in y"?
Charles T. Smith
cts.private.yahoo at gmail.com
Fri Mar 11 16:53:43 EST 2016
More information about the Python-list mailing list
Fri Mar 11 16:53:43 EST 2016
- Previous message (by thread): hasattr() or "x in y"?
- Next message (by thread): hasattr() or "x in y"?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 11 Mar 2016 21:44:27 +0000, Charles T. Smith wrote: > From the performance point of view, which is better: - hasattr() > - x in y > > TIA > cts I just realized that "in" won't look back through the class hierarchy... that clearly makes them not interchangable, but given we're only interested in the current dict...
- Previous message (by thread): hasattr() or "x in y"?
- Next message (by thread): hasattr() or "x in y"?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list