Movatterモバイル変換


[0]ホーム

URL:


Following system colour schemeSelected dark colour schemeSelected light colour scheme

Python Enhancement Proposals

PEP 233 – Python Online Help

Author:
Paul Prescod <paul at prescod.net>
Status:
Deferred
Type:
Standards Track
Created:
11-Dec-2000
Python-Version:
2.1
Post-History:


Table of Contents

Abstract

This PEP describes a command-line driven online help facility forPython. The facility should be able to build on existingdocumentation facilities such as the Python documentation anddocstrings. It should also be extensible for new types andmodules.

Interactive use

Simply typinghelp describes the help function (throughrepr()overloading).

help can also be used as a function.

The function takes the following forms of input:

  • help("string") – built-in topic or global
  • help(<ob>) – docstring from object or type
  • help("doc:filename") – filename from Python documentation

If you ask for a global, it can be a fully-qualified name, such as:

help("xml.dom")

You can also use the facility from a command-line:

python--helpif

In either situation, the output does paging similar to themorecommand.

Implementation

The help function is implemented in anonlinehelp module which isdemand-loaded.

There should be options for fetching help information fromenvironments other than the command line through theonlinehelpmodule:

onlinehelp.gethelp(object_or_string)->string

It should also be possible to override the help display functionby assigning toonlinehelp.displayhelp(object_or_string).

The module should be able to extract module information fromeither the HTML or LaTeX versions of the Python documentation.Links should be accommodated in a “lynx-like” manner.

Over time, it should also be able to recognize when docstrings arein “special” syntaxes like structured text, HTML and LaTeX anddecode them appropriately.

A prototype implementation is available with the Python sourcedistribution asnondist/sandbox/doctools/onlinehelp.py.

Built-in Topics

  • help("intro") – What is Python? Read this first!
  • help("keywords") – What are the keywords?
  • help("syntax") – What is the overall syntax?
  • help("operators") – What operators are available?
  • help("builtins") – What functions, types, etc. are built-in?
  • help("modules") – What modules are in the standard library?
  • help("copyright") – Who owns Python?
  • help("moreinfo") – Where is there more information?
  • help("changes") – What changed in Python 2.0?
  • help("extensions") – What extensions are installed?
  • help("faq") – What questions are frequently asked?
  • help("ack") – Who has done work on Python lately?

Security Issues

This module will attempt to import modules with the same names asrequested topics. Don’t use the modules if you are not confidentthat everything in yourPYTHONPATH is from a trusted source.


Source:https://github.com/python/peps/blob/main/peps/pep-0233.rst

Last modified:2025-02-01 08:55:40 GMT


[8]ページ先頭

©2009-2025 Movatter.jp