The opening line:<p>&gt;Don’t use Python’s hasattr() unless you want its quirks or are writing Python 3-only code.<p>At this point, you should be writing Python 3-only code. Maybe I should write a post, &quot;Python 2 considered harmful&quot;.