Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings.__all__ incomplete #66387

Closed
pitrou opened this issue Aug 13, 2014 · 12 comments
Closed

warnings.__all__ incomplete #66387

pitrou opened this issue Aug 13, 2014 · 12 comments
Assignees
Labels
easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Aug 13, 2014

BPO 22191
Nosy @brettcannon, @ncoghlan, @pitrou, @serhiy-storchaka
Files
  • warnings.all.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2014-08-22.14:51:16.655>
    created_at = <Date 2014-08-13.13:42:16.899>
    labels = ['easy', 'type-bug', 'library']
    title = 'warnings.__all__ incomplete'
    updated_at = <Date 2014-08-23.14:01:24.958>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2014-08-23.14:01:24.958>
    actor = 'jon.poler'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2014-08-22.14:51:16.655>
    closer = 'brett.cannon'
    components = ['Library (Lib)']
    creation = <Date 2014-08-13.13:42:16.899>
    creator = 'pitrou'
    dependencies = []
    files = ['36383']
    hgrepos = []
    issue_num = 22191
    keywords = ['patch', 'easy']
    message_count = 12.0
    messages = ['225279', '225285', '225286', '225293', '225296', '225299', '225375', '225667', '225668', '225670', '225672', '225749']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'ncoghlan', 'pitrou', 'python-dev', 'serhiy.storchaka', 'jon.poler']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue22191'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @pitrou
    Copy link
    Member Author

    pitrou commented Aug 13, 2014

    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.

    @pitrou pitrou added stdlib Python modules in the Lib dir easy type-bug An unexpected behavior, bug, or error labels Aug 13, 2014
    @jonpoler
    Copy link
    Mannequin

    jonpoler mannequin commented Aug 13, 2014

    Antoine:

    I'll look in to this unless you want do so yourself.

    Thanks.

    @pitrou
    Copy link
    Member Author

    pitrou commented Aug 13, 2014

    Jon, please do!

    @serhiy-storchaka
    Copy link
    Member

    See also bpo-20689. socket.__all__ is incomplete too.

    @jonpoler
    Copy link
    Mannequin

    jonpoler mannequin commented Aug 14, 2014

    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?

    @brettcannon
    Copy link
    Member

    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. =)

    @jonpoler
    Copy link
    Mannequin

    jonpoler mannequin commented Aug 16, 2014

    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).

    @brettcannon brettcannon self-assigned this Aug 16, 2014
    @brettcannon
    Copy link
    Member

    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.

    @brettcannon
    Copy link
    Member

    And Python 2.7.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 22, 2014

    New changeset a77dc87a34ff by Brett Cannon in branch '3.4':
    Issue bpo-22191: Fix warnings.__all__.
    http://hg.python.org/cpython/rev/a77dc87a34ff

    New changeset aeb5fc7a9956 by Brett Cannon in branch 'default':
    Merge for issue bpo-22191 fix
    http://hg.python.org/cpython/rev/aeb5fc7a9956

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 22, 2014

    New changeset 727fd4ead3fd by Brett Cannon in branch '2.7':
    Issue bpo-22191: Fix warnings.__all__.
    http://hg.python.org/cpython/rev/727fd4ead3fd

    @jonpoler
    Copy link
    Mannequin

    jonpoler mannequin commented Aug 23, 2014

    Thanks, Brett!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants