[Python-Dev] pydoc for named tuples is missing methods

Tim Lesher tlesher at gmail.com
Tue Mar 15 17:27:43 CET 2011


On Tue, Mar 15, 2011 at 11:15, Nick Coghlan <ncoghlan at gmail.com> wrote:
> The challenge here is how it would interact with inheritance. pydoc
> couldn't use normal attribute lookup, it would have to walk the MRO
> manually, only applying __api__ to the specific class that defined it.

Great catch. I know pydoc already looks at this in the
attrs-processing loop (to group attrs by their defining class), but my
current implementation applies __api__ too early to deal with that.
I'll fix it.

Any test cases should definitely throw some diamond-pattern or even
more degenerate cases at the implementation.  What *is* the worst case
for MRO complexity?

Overall, this is becoming more interesting than I'd thought at first.
Is this something that should require a PEP?
-- 
Tim Lesher <tlesher at gmail.com>


More information about the Python-Dev mailing list