[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

Greg Turner report at bugs.python.org
Mon Dec 29 12:55:03 CET 2014


Greg Turner added the comment:

Perhaps it is worth addressing, briefly, the following hypothetical question, as a litmus test against the faint dis-encapsulation code-smell some folks might be picking up from this:

In a hypothetcial world without setuptools, would these changes have merit?

I'd say, technically, yes.  In the Extension case, we are just really trying to ask, "is it a tuple", and in the Distribution case, "Can we use this thing to finalize/reinitialize Commands?", so, in theory, at least, these isinstance() checks are less pythonic than the hasattr checks in my patches.

That stated, I think isinstance was the sensible way to code this in a vacuum, and obviously, I would never have thought this was a fantastic and self-evident proposal, were it not for these setuptools problems.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23102>
_______________________________________


More information about the Python-bugs-list mailing list