[Python-Dev] Pre-PEP Idea
Paul Prescod
paul@prescod.net
Sat, 15 Jul 2000 13:48:20 -0500
Hopefully this transcript will speak for itself...mostly.
>>> help
| The help function allows you to read help on Python's various
| functions, objects, instructions and modules. You have two options:
|
| 1. Use help( obj ) to browse the help attached to some function,
| module, class or other object. e.g. help( dir )
|
| 2. Use help( "somestring" ) to browse help on one of the predefined
| help topics, unassociated with any particular object:
|
| help( "intro" ) - What is Python?
| help( "keywords" ) - What are the keywords?
| help( "syntax" ) - What is the overall syntax?
| help( "operators" ) - What operators are available?
| help( "types" ) - What types are built-in (not extension types)?
| help( "exceptions" ) - What exceptions can be raised?
| 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?
| help( "language" ) - Change the language of the help function
>>>
>>> help( "keywords" )
| "if" - Conditional execution
| "while" - Loop while a condition is true
| "for" - Loop over a sequence of values (often numbers)
| "try" - Set up an exception handler
| "def" - Define a named function
| "class" - Define a class
| "assert" - Check that some code is working as you expect it to.
| "pass" - Do nothing
| "del" - Delete a data value
| "print" - Print a value
| "return" - Return information from a function
| "raise" - Raise an exception
| "break" - Terminate a loop
| "continue" - Skip to the next loop statement
| "import" - Import a module
| "global" - Declare a variable global
| "exec" - Execute some dynamically generated code
| "lambda" - Define an unnamed function
| For more information, type e.g. help("assert")
>>>
>>> help( dir )
| dir([object]) -> list of strings
| Return an alphabetized list of names comprising (some of) the
attributes
| of the given object. Without an argument, the names in the current
scope
| are listed. With an instance argument, only the instance attributes
are
| returned. With a class argument, attributes of the base class are not
| returned. For other types or arguments, this may list members or
methods.
>>>
>>> import pickle
>>> help( pickle )
| create portable serialized representations of Python objects.
| See module cPickle for a (much) faster implementation.
| See module copy_reg for a mechanism for registering custom picklers.
| Classes:
| Pickler
| Unpickler
| Functions:
| dump(object, file)
| dumps(object) -> string
| load(file) -> object
| loads(string) -> object
| Misc variables:
| __version__
| format_version
| compatible_formats
>>>
--
Paul Prescod - Not encumbered by corporate consensus
It's difficult to extract sense from strings, but they're the only
communication coin we can count on.
- http://www.cs.yale.edu/~perlis-alan/quotes.html