Created on 2014-08-22 02:42 by martin.panter, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg225637 - (view) | Author: Martin Panter (martin.panter) * | Date: 2014-08-22 02:42 | |
The nntplib.NNTPError exception is documented, but missing from __all__. I ran across another one the other day, but I can’t remember what it was now.
Is there a practical way to automatically test for some of these, perhaps by scanning the documentation for function and class definitions? These sort of bugs keep popping up, as people adding new features, exceptions, etc, forget to append them to __all__.
Another more radical idea: a decorator something like this might avoid copy-paste errors and make unexported APIs stand out more:
def public(api):
sys.modules[api.__module__].__all__.append(api.__name__)
return api
__all__ = list()
@public
def public_function(): ...
@public
class PublicClass: ...
Related:
* Issue 18554: os.__all__
* Issue 22191: warnings.__all__
|
|||
| msg225663 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2014-08-22 12:18 | |
Issue 20689: socket.__all__ |
|||
| msg227145 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-09-20 05:53 | |
New changeset eb9eac80c17a by Berker Peksag in branch '3.4': Issue #22247: Add NNTPError to nntplib.__all__. https://hg.python.org/cpython/rev/eb9eac80c17a New changeset e21b0bbc06ea by Berker Peksag in branch 'default': Issue #22247: Add NNTPError to nntplib.__all__. https://hg.python.org/cpython/rev/e21b0bbc06ea |
|||
| msg228828 - (view) | Author: Martin Panter (martin.panter) * | Date: 2014-10-09 02:15 | |
Confirmed Python 3.4.2 fixes the missing NNTPError. I never remembered the other instance I found, so I am happy for this to be closed. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:07 | admin | set | github: 66443 |
| 2016-05-10 16:27:57 | jayvdb | set | nosy:
+ jayvdb |
| 2014-10-09 05:04:54 | benjamin.peterson | set | status: open -> closed resolution: fixed |
| 2014-10-09 02:15:29 | martin.panter | set | messages: + msg228828 |
| 2014-09-20 05:53:43 | python-dev | set | nosy:
+ python-dev messages: + msg227145 |
| 2014-08-22 12:18:50 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg225663 |
| 2014-08-22 10:29:36 | berker.peksag | set | nosy:
+ berker.peksag |
| 2014-08-22 02:42:48 | martin.panter | create | |