[Python-ideas] Should iPython Notebook replace Idle

Matthias Bussonnier bussonniermatthias at gmail.com
Mon Jul 6 16:16:54 CEST 2015


> Concept sketch:
>
>     obj? calls sys.__dochook__(obj)
>     obj?? calls sys.__helphook__(obj)
>
> Default implementations:
>
>     def __dochook__(obj):
>         import pydoc
>         print(pydoc.getdoc(obj))
>
>     def __helphook__(obj):
>         help(obj)

That would be great, there are (some) things we should to be careful with.
prevent `obj?` in a loop is the first I can thing of. I know there are
other gotchas.

The second things, it would be nice to allow object to return different mimetype
for their help, which I would like to see in the spec of __dochook__
and __helphook__
and not as a convention that depends on the shell you use.
One of the things we want to play with in IPython (and in particular notebook),
is to have run-able docs (yes with all the security concern that could imply),
for which we would need richer data.

I also want to point out that `?` also allow to do search for object
name matching regex,
which I like too.

In [7]: ?numpy.*str*
numpy.__str__
numpy.add_docstring
numpy.array2string
numpy.array_str
numpy.datetime_as_string
numpy.fromstring
numpy.set_string_function
numpy.str
numpy.str0
numpy.str_
numpy.string_

-- 
M

On Mon, Jul 6, 2015 at 12:09 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 6 July 2015 at 14:23, Wes Turner <wes.turner at gmail.com> wrote:
>> * Python readline tab completion (without IDLE or IPython or bpython):
>> http://pymotw.com/2/rlcompleter/ ... I'm sure there's a reason why this is
>> not the default
>
> It's been the default since 3.4:
> https://docs.python.org/dev/whatsnew/3.4.html#sys
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list