classification
Title: pydoc enum.{,Int}Enum fails
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Antony.Lee, barry, eli.bendersky, ethan.furman, martin.panter, python-dev, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-12-08 06:04 by Antony.Lee, last changed 2015-04-21 18:12 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
pydoc_resolve_false.patch serhiy.storchaka, 2015-04-11 18:22 review
pydoc_resolve_false_2.patch serhiy.storchaka, 2015-04-14 08:00 review
Messages (8)
msg232298 - (view) Author: Antony Lee (Antony.Lee) * Date: 2014-12-08 06:04
Not a big deal, but "$ pydoc enum.Enum" and "$ pydoc enum.IntEnum" fail to retrieve the docstrings, while they are visible with "$ pydoc enum".
msg240490 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-11 18:22
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.
msg240495 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-04-11 21:38
Lgtm, needs a test case.
msg240511 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-04-11 23:34
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.
msg240543 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2015-04-12 05:53
In 3.5 at least 'pydoc None' works.
msg240855 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-04-14 08:00
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.
msg241727 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2015-04-21 17:29
Patch looks good, get it in!  :)
msg241728 - (view) Author: Roundup Robot (python-dev) Date: 2015-04-21 18:11
New changeset d1b9eb9de8af by Serhiy Storchaka in branch '2.7':
Issue #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 #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 #23008: Fixed resolving attributes with boolean value is False in pydoc.
https://hg.python.org/cpython/rev/03330e5edb37
History
Date User Action Args
2015-04-21 18:12:13serhiy.storchakasetstatus: open -> closed
assignee: serhiy.storchaka
resolution: fixed
stage: patch review -> resolved
2015-04-21 18:11:48python-devsetnosy: + python-dev
messages: + msg241728
2015-04-21 17:29:51ethan.furmansetmessages: + msg241727
2015-04-14 08:00:55serhiy.storchakasetfiles: + pydoc_resolve_false_2.patch

messages: + msg240855
stage: test needed -> patch review
2015-04-12 05:53:39ethan.furmansetmessages: + msg240543
stage: patch review -> test needed
2015-04-11 23:34:22martin.pantersetnosy: + martin.panter
messages: + msg240511
2015-04-11 21:38:39r.david.murraysetnosy: + r.david.murray
messages: + msg240495
2015-04-11 18:22:21serhiy.storchakasetfiles: + pydoc_resolve_false.patch

versions: + Python 2.7, Python 3.5
keywords: + patch
nosy: + serhiy.storchaka

messages: + msg240490
stage: patch review
2015-04-11 16:52:47ethan.furmansetnosy: + barry, eli.bendersky
2015-03-08 17:08:07BreamoreBoysettype: behavior
2014-12-08 16:14:47berker.peksagsetnosy: + ethan.furman
2014-12-08 06:04:08Antony.Leecreate