Troy Curtis Jr wrote on Wed, 27 Dec 2017 02:48 +0000:
> In taking another look at why hasattr() seeming fails in certain cases on
> SWIG generated new style classes under python2, I ran across this article,
> https://hynek.me/articles/hasattr/, which confirms that python 2's
> hasattr() can misbehave in the presence of properties (which the
> non-classic SWIG classes use).  So this appears to be a known discrepancy.
> I did change the code to no hide any AttributeError's encountered in the
> assert_valid() method call itself.

If I'm reading the article correctly, it didn't actually explain why
hasattr() false negatived, but it did say that hasattr() is an
antipattern, which  supports r1819110.

Fair enough :-)

Thanks,

Daniel

Reply via email to