msg225279 - (view) |
Author: Antoine Pitrou (pitrou) *  |
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) *  |
Date: 2014-08-13 20:05 |
Jon, please do! |
|
|
msg225293 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
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) *  |
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) *  |
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) *  |
Date: 2014-08-22 14:37 |
And Python 2.7. |
|
|
msg225670 - (view) |
Author: Roundup Robot (python-dev)  |
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)  |
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! |
|
|