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

pydoc enum.{,Int}Enum fails #67197

Closed
anntzer mannequin opened this issue Dec 8, 2014 · 8 comments
Closed

pydoc enum.{,Int}Enum fails #67197

anntzer mannequin opened this issue Dec 8, 2014 · 8 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@anntzer
Copy link
Mannequin

anntzer mannequin commented Dec 8, 2014

BPO 23008
Nosy @warsaw, @bitdancer, @ethanfurman, @vadmium, @serhiy-storchaka, @anntzer
Files
  • pydoc_resolve_false.patch
  • pydoc_resolve_false_2.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/serhiy-storchaka'
    closed_at = <Date 2015-04-21.18:12:13.137>
    created_at = <Date 2014-12-08.06:04:08.288>
    labels = ['type-bug', 'library']
    title = 'pydoc enum.{,Int}Enum fails'
    updated_at = <Date 2015-04-21.18:12:13.136>
    user = 'https://github.com/anntzer'

    bugs.python.org fields:

    activity = <Date 2015-04-21.18:12:13.136>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-04-21.18:12:13.137>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2014-12-08.06:04:08.288>
    creator = 'Antony.Lee'
    dependencies = []
    files = ['38899', '38983']
    hgrepos = []
    issue_num = 23008
    keywords = ['patch']
    message_count = 8.0
    messages = ['232298', '240490', '240495', '240511', '240543', '240855', '241727', '241728']
    nosy_count = 8.0
    nosy_names = ['barry', 'r.david.murray', 'eli.bendersky', 'ethan.furman', 'python-dev', 'martin.panter', 'serhiy.storchaka', 'Antony.Lee']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23008'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @anntzer
    Copy link
    Mannequin Author

    anntzer mannequin commented Dec 8, 2014

    Not a big deal, but "$ pydoc enum.Enum" and "$ pydoc enum.IntEnum" fail to retrieve the docstrings, while they are visible with "$ pydoc enum".

    @anntzer anntzer mannequin added the stdlib Python modules in the Lib dir label Dec 8, 2014
    @BreamoreBoy BreamoreBoy mannequin added the type-bug An unexpected behavior, bug, or error label Mar 8, 2015
    @serhiy-storchaka
    Copy link
    Member

    This is because bool(enum.Enum) is False. Other example:

    $ pydoc3 builtins.False
    no Python documentation found for 'builtins.False'
    
    $ pydoc3 builtins.True
    Help on bool in builtins object:
    builtins.True = class bool(int)
    ...

    Here is simple fix.

    @bitdancer
    Copy link
    Member

    Lgtm, needs a test case.

    @vadmium
    Copy link
    Member

    vadmium commented Apr 11, 2015

    The fix is definitely an improvement. Though there is still one obvious flaw remaining, which applies to any attribute that is set to None:

    $ ~/proj/python/cpython/python -bWall -m pydoc builtins.None
    No Python documentation found for 'builtins.None'.
    Use help() to get the interactive help utility.
    Use help(str) for help on the str class.

    @ethanfurman
    Copy link
    Member

    In 3.5 at least 'pydoc None' works.

    @serhiy-storchaka
    Copy link
    Member

    I think we can ignore this flaw. 'pydoc None' works, and any solution for None aliases could break existing code that use private pydoc functions.

    Here is a patch with a test.

    @ethanfurman
    Copy link
    Member

    Patch looks good, get it in! :)

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 21, 2015

    New changeset d1b9eb9de8af by Serhiy Storchaka in branch '2.7':
    Issue bpo-23008: Fixed resolving attributes with boolean value is False in pydoc.
    https://hg.python.org/cpython/rev/d1b9eb9de8af

    New changeset a480f470c469 by Serhiy Storchaka in branch '3.4':
    Issue bpo-23008: Fixed resolving attributes with boolean value is False in pydoc.
    https://hg.python.org/cpython/rev/a480f470c469

    New changeset 03330e5edb37 by Serhiy Storchaka in branch 'default':
    Issue bpo-23008: Fixed resolving attributes with boolean value is False in pydoc.
    https://hg.python.org/cpython/rev/03330e5edb37

    @serhiy-storchaka serhiy-storchaka self-assigned this Apr 21, 2015
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants