Issue 22191: warnings.all incomplete - Python tracker (original) (raw)

Created on 2014-08-13 13:42 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
warnings.__all__.patch jon.poler,2014-08-16 00:00 review
Messages (12)
msg225279 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-08-13 13:42
If you try `pydoc warnings` (or `help(warnings)` in the interpreter prompt) you'll notice that some functions such as simplefilter() don't appear. This seems to be because warnings.__all__ is incomplete.
msg225285 - (view) Author: Jon Poler (jon.poler) * Date: 2014-08-13 19:15
Antoine: I'll look in to this unless you want do so yourself. Thanks.
msg225286 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-08-13 20:05
Jon, please do!
msg225293 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-14 10:02
See also . socket.__all__ is incomplete too.
msg225296 - (view) Author: Jon Poler (jon.poler) * Date: 2014-08-14 12:57
Serhiy, should I submit these fixes as separate patches? E.g. one patch for the warnings module, and another for the socket module? More generally, should the items included in __all__ be derived from the items described in the documentation? For instance, only the functions listed in 18.1.2 https://docs.python.org/dev/library/socket.html#module-contents ? And finally, should a unittest be added for both of these modules to ensure that __all__ includes all of the desired publicly exposed elements?
msg225299 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-08-14 14:05
Yes, please use separate patches attached to the appropriate bug. As for what should go into __all__, it's what is documented as the API of the module. As for tests, it doesn't hurt. =)
msg225375 - (view) Author: Jon Poler (jon.poler) * Date: 2014-08-16 00:00
Here is a patch that changes __all__ in Lib/warnings.py to include the functions mentioned in the library reference https://docs.python.org/dev/library/warnings.html#available-functions. A unittest is included. This is my first patch, so comments/feedback are welcome (from now on, I should probably add).
msg225667 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-08-22 14:37
The patch looks good, Jon! I'm running the test suite now to make sure nothing odd happens from the change, but barring that this should be committed in Python 3.4 and default shortly.
msg225668 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-08-22 14:37
And Python 2.7.
msg225670 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-22 14:46
New changeset a77dc87a34ff by Brett Cannon in branch '3.4': Issue #22191: Fix warnings.__all__. http://hg.python.org/cpython/rev/a77dc87a34ff New changeset aeb5fc7a9956 by Brett Cannon in branch 'default': Merge for issue #22191 fix http://hg.python.org/cpython/rev/aeb5fc7a9956
msg225672 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-22 14:50
New changeset 727fd4ead3fd by Brett Cannon in branch '2.7': Issue #22191: Fix warnings.__all__. http://hg.python.org/cpython/rev/727fd4ead3fd
msg225749 - (view) Author: Jon Poler (jon.poler) * Date: 2014-08-23 14:01
Thanks, Brett!
History
Date User Action Args
2022-04-11 14:58:06 admin set github: 66387
2014-08-23 14:01:24 jon.poler set messages: +
2014-08-22 14:51:16 brett.cannon set status: open -> closedresolution: fixedstage: commit review -> resolved
2014-08-22 14:50:54 python-dev set messages: +
2014-08-22 14:46:18 python-dev set nosy: + python-devmessages: +
2014-08-22 14:37:39 brett.cannon set status: pending -> openmessages: +
2014-08-22 14:37:23 brett.cannon set status: open -> pendingmessages: + stage: commit review
2014-08-16 14:21:10 brett.cannon set assignee: brett.cannon
2014-08-16 00:00:06 jon.poler set files: + warnings.__all__.patchkeywords: + patchmessages: +
2014-08-14 14:05:56 brett.cannon set messages: +
2014-08-14 12:57:48 jon.poler set messages: +
2014-08-14 10:02:10 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2014-08-13 20:05:47 pitrou set messages: +
2014-08-13 19:15:36 jon.poler set nosy: + jon.polermessages: +
2014-08-13 13:42:16 pitrou create