[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1819110 - /subversion/branches/swig-py3/subversion/bindings/swig/include/proxy.swg

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 27 Dec 2017 04:11:01 +0000

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
Received on 2017-12-27 05:11:16 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.