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

help(x) for keywords too #44092

Closed
jimjjewett mannequin opened this issue Oct 6, 2006 · 9 comments
Closed

help(x) for keywords too #44092

jimjjewett mannequin opened this issue Oct 6, 2006 · 9 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@jimjjewett
Copy link
Mannequin

jimjjewett mannequin commented Oct 6, 2006

BPO 1572210
Nosy @theller, @birkenfeld, @rhettinger

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 = None
closed_at = <Date 2008-01-05.19:33:57.683>
created_at = <Date 2006-10-06.15:06:40.000>
labels = ['type-feature', 'library']
title = 'help(x) for keywords too'
updated_at = <Date 2008-01-05.19:33:57.682>
user = 'https://bugs.python.org/jimjjewett'

bugs.python.org fields:

activity = <Date 2008-01-05.19:33:57.682>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2008-01-05.19:33:57.683>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2006-10-06.15:06:40.000>
creator = 'jimjjewett'
dependencies = []
files = []
hgrepos = []
issue_num = 1572210
keywords = []
message_count = 9.0
messages = ['54917', '54918', '54919', '54920', '54921', '54922', '54923', '59214', '59311']
nosy_count = 5.0
nosy_names = ['theller', 'georg.brandl', 'rhettinger', 'jimjjewett', 'JosephArmbruster']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue1572210'
versions = ['Python 2.6']

@jimjjewett
Copy link
Mannequin Author

jimjjewett mannequin commented Oct 6, 2006

At the interactive prompt, help(object) is very useful.

It would be nice if it also worked on keywords.

"""
>>> help(object)
Help on class object in module __builtin__:

class object
| The most base type
"""

vs

"""
>>> help(with)
SyntaxError: invalid syntax
"""

At the moment, the workaround is to open the
documentation, pick a document that doesn't seem quite
right (language reference?), go to the index, and look
for the keyword.

@jimjjewett jimjjewett mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Oct 6, 2006
@birkenfeld
Copy link
Member

Logged In: YES
user_id=849994

Doesn't help("if") work for you?

@jimjjewett
Copy link
Mannequin Author

jimjjewett mannequin commented Oct 6, 2006

Logged In: YES
user_id=764593

No, it doesn't -- but putting the keyword in quotes does at
least change the error message to saying that topic and
keyword documentation is not available because the Python
HTML documentation files could not be found.

I'm using Windows XP, the 2.4 and 2.5 binaries from
python.org, if I changed anything it was just the install
directory to be Python2.5 (or 2.4 for 2.4))

The documentation (as a chm file) is found by the F1 key.
Is this likely to be a windows build issue?

@theller
Copy link

theller commented Oct 6, 2006

Logged In: YES
user_id=11105

Is this likely to be a windows build issue?

No. pydoc cannot use the .chm file. Either you should
download the HTML files yourself, or you can compile the
.chm file in a windows command shell (note that the
decompilation runs in the background, and has no user
interface):

C:\Python24\Doc>hh -decompile . Python24.chm

C:\Python24\Doc>dir *.chm
Datenträger in Laufwerk C: ist ...
Volumeseriennummer: ...

Verzeichnis von C:\Python24\Doc

06.10.2006 21:23 3.732 about.html
06.10.2006 21:23 8.689 acks.html
06.10.2006 21:23 4.445 index.html
06.10.2006 21:23 35.525 modindex.html
4 Datei(en) 52.391 Bytes
0 Verzeichnis(se), 8.506.798.080 Bytes frei

C:\Python24\Doc>

The other HTML files are created in subdirectories, and
help("if") now works.

@jimjjewett
Copy link
Mannequin Author

jimjjewett mannequin commented Nov 21, 2006

1600491 contains a doc patch, which is basically just adding Tom Heller's advice on *how* to build to the error message.

@rhettinger
Copy link
Contributor

Ideally, if help() doesn't find local HTML files, it should be smart enough to look on doc.python.org. People who need help are not usually in a position to build their own help files.

@jimjjewett
Copy link
Mannequin Author

jimjjewett mannequin commented Nov 27, 2006

Pointing to docs.python.org doesn't help if you don't have a current net connection.

In this case, the build instructions *are* the single line from Thomas:

C:\Python24\Doc>hh -decompile . Python25.chm

Since hh comes with windows, the barrier is fairly low.

@JosephArmbruster
Copy link
Mannequin

JosephArmbruster mannequin commented Jan 4, 2008

This issue should probably be closed. Performing the decompile on the
command line as directed by the interpreter is as trivial as firing up
the interpreter itself.

It would make more sense to add an option to the installer that would
automagically perform the decompile of the docs via an option or
something at the users request.

Your Thoughts?

@birkenfeld
Copy link
Member

1600491 was applied, so I'm closing this.

@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-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants