This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Unit03
Recipients Unit03, berker.peksag, martin.panter, maurosr, milap.py, python-dev, r.david.murray, serhiy.storchaka, taddeimania
Date 2015-07-05.09:57:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436090243.11.0.548501139651.issue23883@psf.upfronthosting.co.za>
In-reply-to
Content
> In any case it is too late for 3.5.

Ok, next round of patches is based on default branch.

> Jacek: If we used the ModuleType check, and somebody adds a module-level constant (like logging.CRITICAL = 50), the test will automatically detect if they forget to update __all__. That is what I meant by the test being stricter.

Right and I think such case should be covered as well. I think it may be worth the hassle of adding new condition in detecting names expected to be documented, so the whole if clause would look like:

if (getattr(module_object, '__module__', None) in name_of_module
        or (not isinstance(module_object, types.ModuleType)
            and not hasattr(module_object, '__module__'))):
    expected.add(name)

Obviously tradeoff lies in required blacklisting:
* with previous __module__ check - all undocumented, non "_*" names defined in checked module, but constants need to be in *extra* and new ones won't be detected
* with ModuleType check only - all undocumented, non "_*" names defined in checked module + all functions and classes imported from other modules needs blacklisting
* with extended __module__ check (proposed above) - all undocumented, non "_*" names defined in checked module + all constants imported from other modules; this choice also requires less 'extra' params (in fact, in these patches only csv.__doc/version__ case left)

In this round of patches I went the new, third way.

One odd thing: in test.test_logging, are these:

3783:        self.addCleanup(setattr, logging, 'raiseExecptions', old_raise)
3790:        self.addCleanup(setattr, logging, 'raiseExecptions', old_raise)

("Ex*ec*ptions") really typos or is it intentional? test.test_logging has raiseExceptions name as well.

Also, pickletools.OpcodeInfo and threading.ThreadError are not really documented, are they?
History
Date User Action Args
2015-07-05 09:57:23Unit03setrecipients: + Unit03, r.david.murray, python-dev, berker.peksag, martin.panter, serhiy.storchaka, milap.py, maurosr, taddeimania
2015-07-05 09:57:23Unit03setmessageid: <1436090243.11.0.548501139651.issue23883@psf.upfronthosting.co.za>
2015-07-05 09:57:23Unit03linkissue23883 messages
2015-07-05 09:57:22Unit03create