[issue13691] pydoc help (or help('help')) should show the doc for help

2017-06-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Belatedly removing the "easy" tag, since that turned out to be thoroughly 
incorrect...

--
keywords:  -easy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-04-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Aye, it's definitely a tricky problem. While I didn't take them into account in 
my review, I now realise those issues also impacted the attempted workaround - 
I'd be surprised if it worked as intended in those other contexts (even the 
"pydoc -b" rendered HTML view).

As far as how to deal with the rendering complexity in a protocol, one possible 
way to go would be to say that rather than returning a fully rendered string, 
__help__() methods should return either a Python function object or a type() 
instance (that doesn't define __help__()), and then pydoc would render the help 
based on that.

Regardless of the exact approach, it would be a task requiring a PEP to 
resolve, since rendered documentation appears in so many different contexts.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-04-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> It does make me wonder whether it might be worth defining a __help__ magic 
> method that completely overrides what help(obj) displays.

This should be very complex protocol if take to account that help() outputs 
formatted and highlighted text and pydoc can output to html format, and 
alternative Python shells can provide alternative help().

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-04-09 Thread Nick Coghlan

Nick Coghlan added the comment:

After reviewing Sanyam's PR at https://github.com/python/cpython/pull/172 I 
ended up rejecting it as an approach to resolving this issue.

The core problem with the approach is that accessing `_sitebuiltins._Helper` is 
an implementation detail twice over:

- Python implementations aren't required to have a _sitebuiltins module
- that module isn't required to contain a _Helper class

That means importing it into a general purpose module like pydoc would couple 
pydoc specifically to the way CPython works, which is something we try to avoid 
doing.

By contrast, a richer `__help__()` protocol to override the `__doc__` based 
default behaviour would allow any object to implement it, and 
_sitebuiltins._Helper could just use that protocol to special case itself.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-02-18 Thread Jaysinh shukla

Changes by Jaysinh shukla :


--
nosy: +jaysinh.shukla

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-02-18 Thread Sanyam Khurana

Changes by Sanyam Khurana :


--
pull_requests: +138

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-02-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Recapping the situations that need test cases before this can be merged:

* behaviour when "help" is entered at the interactive help prompt (as the 
current behaviour is correct and should *not* change)
* behaviour when calling "help(help)"
* behaviour when calling "help('help')"
* behaviour when running "python3 -m pydoc help"

In the latter 3 cases, the default site._Helper docs currently shown are not 
particularly helpful.

It does make me wonder whether it might be worth defining a __help__ magic 
method that completely overrides what help(obj) displays. It would limit the 
fix to 3.7+, but it would make it possible to do this cleanly just by defining 
__help__ on site._Helper.

--
nosy: +ncoghlan
versions: +Python 3.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2017-02-18 Thread Sanyam Khurana

Sanyam Khurana added the comment:

Hi, I'm working on fixing this issue.

--
nosy: +CuriousLearner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2016-08-13 Thread R. David Murray

R. David Murray added the comment:

No 3.4 can't be patched, this is not a security issue.  A patch to make the 
behvior what we want should be generated against either 3.5 or 3.6, and the 
committer will deal with any issues arising from 3.5 vs 3.6 issues.

--
versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2016-08-13 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +Cubky, Devin Jeanpierre, eric.araujo, ezio.melotti, jairotrad, jbitcm-, 
mikehoy, r.david.murray, terry.reedy -lissacoffeyx

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2016-08-13 Thread SilentGhost

Changes by SilentGhost :


--
Removed message: http://bugs.python.org/msg272582

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2016-08-13 Thread lissacoffeyx

lissacoffeyx added the comment:

I just tested this issue in Python 3.6.0a0 and got this behavior:

help('help') brings 

"Help on _Helper in module _sitebuiltins object:"

help(help) brings:
Help on _Helper in module _sitebuiltins object:

help() invokes the help command line.

So this was fixes on the way to python3.6, I can make the test for 3.4 but is 
3.4 closed for bug fixing?

Can someone check this in 3.5? 
http://www.followthesteps.net/sky-contact-phone-number/

--
nosy: +lissacoffeyx -Cubky, Devin Jeanpierre, eric.araujo, ezio.melotti, 
jairotrad, jbitcm-, mikehoy, r.david.murray, terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2015-08-16 Thread Jairo Trad

Jairo Trad added the comment:

I just tested this issue in Python 3.6.0a0 and got this behavior:

help('help') brings 

Help on _Helper in module _sitebuiltins object:

help(help) brings:
Help on _Helper in module _sitebuiltins object:

help() invokes the help command line.

So this was fixes on the way to python3.6, I can make the test for 3.4 but is 
3.4 closed for bug fixing?

Can someone check this in 3.5?

--
nosy: +jairotrad

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2015-08-16 Thread Terry J. Reedy

Terry J. Reedy added the comment:

3.5 is the same as 3.6 in that now both help(help) and help('help') show the 
not terribly helpful Help on _Helper in module site object: Buried in the 
text is  
 |  Calling help() at the Python prompt starts an interactive help session.
 |  Calling help(thing) prints help for the python object 'thing'.

As before, I think the _Helpter stuff should be eliminated and 
explanation added for help('topic') and a description of what 'topic's are 
specially recognized.

There has been this improvement
 help('jslfjslfdjlskfj')  # 3.4
no Python documentation found for 'jslfjslfdjlskfj'

 help('jsflksjflkjsl')  # 3.5
No Python documentation found for 'jsflksjflkjsl'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.

but the latter omits decription of what 'topic' will give special output.  By 
experiment, keywords (help('if')), builtins, and unimported modules 
(help('itertools')) works.

Yes, 3.4 can be patched.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-10 Thread Éric Araujo

Éric Araujo added the comment:

Cool!  Can you add tests?

--
stage: needs patch - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-10 Thread Mike Hoy

Mike Hoy added the comment:

 Cool!  Can you add tests?

Nope, I can't add tests.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-10 Thread Éric Araujo

Éric Araujo added the comment:

I was addressing the author of the patch :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-07 Thread Mike Hoy

Changes by Mike Hoy mho...@gmail.com:


--
nosy: +mikehoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-07 Thread Mike Hoy

Mike Hoy added the comment:

I imported this patch on 3.4 and it worked as expected on my system.

help('help') brings up info about help()
help(object) prints the docstring
help() invokes the help

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-07 Thread Éric Araujo

Éric Araujo added the comment:

What about pydoc help?

--
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-10-07 Thread Mike Hoy

Mike Hoy added the comment:

 What about pydoc help?

$ ./python -m pydoc help

Help on built-in function help:

help(...)
Invoke the built-in help system.

help()
The interactive help system starts on the interpreter
console.

help(string)
The string is looked up as the name of a module, function, class, method,
keyword, or documentation topic, and a  help page is printed on the
console.   

help(object)
Generates a help page on the given object.

Or did you mean inside the interpreter?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-06-11 Thread Petr Kubat

Petr Kubat killm...@gmail.com added the comment:

I see. So calling help('help') should produce the documentation on the help() 
function and typing help at the help prompt should print the help for the 
prompt.
Tricky indeed. I think I'll look at it during the day after tomorrow and post 
some results (if any).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-06-10 Thread Petr Kubat

Petr Kubat killm...@gmail.com added the comment:

Is anyone still working on this? If not I would like to make this work.
Although I'm not exactly sure how to tackle this problem since the built-in 
help function is defined as a wrapper around pydoc.help and so the docstring 
used for printing help('help') is actually a docstring of the site._Helper() 
class.
I made a patch that adds a documentation-like message to the pydoc.help 
function when it is called with a 'help' argument, but it doesn't seem clean to 
me.

--
nosy: +Cubky
Added file: http://bugs.python.org/file25933/i13691.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-06-10 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

It doesn't look like anyone is working on it currently.

Yes, getting this right is a bit tricky for exactly the reason you say.  You 
have to make sure you don't break the other uses, and glancing at the patch (I 
haven't looked at the code you are patching) it seems likely that the change to 
the if statement is going to break *something*.  Probably what happens when you 
type 'help' at the 'help' prompt, at a guess.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-06-10 Thread Petr Kubat

Petr Kubat killm...@gmail.com added the comment:

Help at the help prompt does work, I tested that. But if you (or anyone) 
thought of a better way to fix this issue I would be glad to change it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-06-10 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

works in the sense that it produces output.  But it doesn't produce the 
output it used to, which is the same text as the initial banner when you type 
help().  I believe the existing behavior in this case is correct.  With your 
patch it produces the same output as help('help') at the python prompt does, 
and what that output describes doesn't work at the 'help' prompt.

Thanks for tackling this.

Hmm.  How about adding the special case to _Helper.__call__?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-06-10 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Oh, that wouldn't fix 'pydoc help', would it.  So there are probably two places 
where the special case has to be added, which means the code itself should go 
in pydoc and be called from _Helper.__call__ somehow.  (Note, I'm just throwing 
out ideas here, I haven't looked carefully at the code.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13691] pydoc help (or help('help')) should show the doc for help

2012-01-17 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
title: pydoc help (or help('help')) claims to run a help utility; does nothing 
- pydoc help (or help('help')) should show the doc for help

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13691
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com