hasattr() or "x in y"?

Chris Angelico rosuav at gmail.com
Fri Mar 11 16:55:20 EST 2016


On Sat, Mar 12, 2016 at 8:44 AM, Charles T. Smith
<cts.private.yahoo at gmail.com> wrote:
> From the performance point of view, which is better:
> - hasattr()
> - x in y
>

Mu. They do completely different things.

ChrisA



More information about the Python-list mailing list