Commit Graph

4700 Commits

Author SHA1 Message Date
Jeremy Hylton 88955cbe1f Change reference to execframes to naming. 2002-04-01 21:34:28 +00:00
Jeremy Hylton e604875b81 Restore a minimal definition of execution frame, since other parts of
the manual refer to it.

XXX Not sure that it belongs in this section, or that the concept is
particularly important for writing documentation.  Perhaps references
to the frame should be removed entirely.
2002-04-01 21:33:55 +00:00
Jeremy Hylton 1824b59e89 Update programmer's note on nested functions. 2002-04-01 21:30:15 +00:00
Jeremy Hylton f3255c8540 Reword explanation of global statement since an undeclared global is a
free variable and is subject to those rules.
2002-04-01 21:25:32 +00:00
Jeremy Hylton f0c1f1badb Note the sole case in which the ban on "from ... import *" within a
function is enforced.
2002-04-01 21:19:44 +00:00
Jeremy Hylton 15b68976da Remove the following restriction:
Names bound by import statements may not occur in global
    statements in the same scope.

Why not?
2002-04-01 21:18:02 +00:00
Jeremy Hylton d09ed68aeb Note that it is illegal to delete a cell variable.
Note that deleteing an unbound local will raise a NameError.
2002-04-01 21:15:14 +00:00
Jeremy Hylton 2225add242 Given lambda its own section, instead of burying it in boolean operators. 2002-04-01 21:05:21 +00:00
Jeremy Hylton 53ed917d3a Update / simplify Identifiers section for nested scopes.
How do I create a cross reference to section 4.1?
2002-04-01 20:52:24 +00:00
Jeremy Hylton e7d5773ed0 Update docs for nested scopes.
Replace section 4.1 with section A.3.

The new section 4.1 is titled "Naming and binding."  It includes the
text of section A.3 augmented with some of the detailed text from the
old section 4.1.

The \dfn, \index stuff is probably wrong, but I tried.

Also update other parts of appendix A to mention that nested scopes
and generators are standard features.
2002-04-01 20:38:01 +00:00
Fred Drake f54519d9e4 Update to push the docs to python.org instead of python.sf.net. 2002-04-01 20:15:05 +00:00
Andrew M. Kuchling f4dd65db1d Copy section on generators from the 2.2 document with a bit of rewriting
Add an item
2002-04-01 19:28:09 +00:00
Andrew M. Kuchling 9da3efd120 Mention 2.2.1 in intro and in bug/patch counts
Fix two typos spotted by Joonas Paalasmaa
2002-04-01 19:22:34 +00:00
Jeremy Hylton 8392f36579 Update documentation of code objects.
Split the description of co_flags into two paragraphs.  The first
describes the flags that are used for non-future purposes, where
CO_GENERATOR was added.  The second describes __future__'s use of
co_flags and mentions the only one currently meaningful,
CO_FUTURE_DIVISION.
2002-04-01 18:53:36 +00:00
Fred Drake c9319b37a5 Minor adjustments. 2002-04-01 18:49:45 +00:00
Jeremy Hylton 26c49b66bb Small fixes for description of function attributes.
func_closure is a readonly attribute.
Add \ttindex{} for func_closure.
Remove discussion of func_closure specific to 2.1.
2002-04-01 17:58:39 +00:00
Fred Drake fe5a5388c3 Use the right types for a couple of fields of the type structure. 2002-03-29 22:46:04 +00:00
Fred Drake 0ffd14c9ea Started updating information about defining attributes on types.
There's still a long way to go, but we're starting to see some real
content in the docs.
2002-03-29 22:45:28 +00:00
Fred Drake b1af6376e9 Mark a couple of types that had not been marked. 2002-03-28 23:46:41 +00:00
Fred Drake 0f9a34da2c Added comments for more entries of the type structure in the example
type implementation.
2002-03-28 23:45:22 +00:00
Fred Drake 2ab0a10913 The new files included by \verbatiminput in newtypes.tex. 2002-03-28 23:32:53 +00:00
Fred Drake 81b750d467 Move some of the longer example code to external fragments, and
include them using \verbatiminput.  This has the advantage that pages
can still break at reasonable places, and examples that go longer than
a page won't get cut off.

Make a few small markup adjustments for consistency.

Explain that PyObject_New() is not a C function but a polymorphic
beast that returns a pointer to the type that's passed as the first
arg.

Explain why type objects use the PyObject_VAR_HEAD.
2002-03-28 23:12:09 +00:00
Fred Drake e9fba9188e Added index entries. 2002-03-28 22:36:56 +00:00
Fred Drake 00f712ee24 Extend \verbatiminput so that the typeset version provides the same appearance
as a verbatim environment.  (The HTML version is already fine.)
2002-03-28 22:28:43 +00:00
Fred Drake 8d62e94761 Minor wording change. 2002-03-28 21:06:17 +00:00
Skip Montanaro bb6bbc45c0 add exception class hierarchy. This should probably be done differently,
but at least the content is there.
2002-03-28 20:53:22 +00:00
Fred Drake 31f8483eef Allow a page break in a code longish example. 2002-03-28 20:19:23 +00:00
Fred Drake 47cdf6fb6f Add documentation on the hasfree data object. 2002-03-28 19:34:53 +00:00
Fred Drake e3a3ceb2b1 Minor consistency adjustments. 2002-03-28 12:40:45 +00:00
Fred Drake 7bf9715a8b Introduce two new flag bits that can be set in a PyMethodDef method
descriptor, as used for the tp_methods slot of a type.  These new flag
bits are both optional, and mutually exclusive.  Most methods will not
use either.  These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.

If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.

If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.

These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.
2002-03-28 05:33:33 +00:00
Fred Drake ed6a886d9f Ignore new output directory. 2002-03-27 20:37:04 +00:00
Martin v. Löwis 2e64c34850 Expose C library's gettext. Fixes #516412. 2002-03-27 18:49:02 +00:00
Skip Montanaro 8a79727b53 add seealso referring to site module doc where people can learn how to
extend sys.path using .pth files.
2002-03-27 17:29:50 +00:00
Skip Montanaro 9e38c100ab fix a typo in PyErr_Format table and add row for 'p' format char
closes bug 534495
2002-03-27 13:42:50 +00:00
Andrew M. Kuchling 03594bbb0e Fill in this document a bit, adding reminders of items that should be included 2002-03-27 02:29:48 +00:00
Fred Drake 4e526feb6a Add the "What's New" document to the index of HTML documents. 2002-03-26 20:29:11 +00:00
Fred Drake 69f0a8e42f The <link> to the stylesheet should include the type attribute. 2002-03-26 19:57:52 +00:00
Fred Drake 3014086fbf Wire up the makefile to more fully support the "What's New" documents. 2002-03-26 19:53:56 +00:00
Fred Drake 9ac14decde Wire in the "What's New" document. 2002-03-26 19:18:18 +00:00
Fred Drake 03e1031d67 Add a starter for the next "What's New" document. 2002-03-26 19:17:43 +00:00
Fred Drake 15fc72ce77 Make \url to force horizontal mode. 2002-03-26 19:14:41 +00:00
Fred Drake 57f8e06e4f Document the finditer() function and method.
This closes SF bug #520904.

Explain that many of the escapes supported by string literals are also
supported by the RE compiler, and list which ones.
This closes SF bug #529923.
2002-03-25 20:22:59 +00:00
Fred Drake 3787c9d94c Added description of binhex.Error. 2002-03-25 16:37:56 +00:00
Skip Montanaro 1e962cb61b document InvalidURL exception 2002-03-24 16:55:57 +00:00
Neil Schemenauer ccbb0edf0e Add local_hostname to SMTP.__init__(). 2002-03-24 15:41:40 +00:00
Neil Schemenauer 194152845c Fix example for PyErr_SetFromErrno() (need to pass exception type). 2002-03-23 20:57:11 +00:00
Neil Schemenauer 79f181395b Add more example exceptions that unpickling can raise. 2002-03-22 22:16:03 +00:00
Fred Drake cf43004b83 Fix broken HTML in the head; this was reported by a user as causing Opera 6.01
to crash.  The user has reported the problem to Opera, but we still should
generate something that passes for HTML.
2002-03-22 17:22:38 +00:00
Neal Norwitz e22d3dfcc1 Fix grammar 2002-03-21 12:58:54 +00:00
Walter Dörwald b25c2b0a4a [Apply SF patch #504943]
This patch makes it possible to pass Warning instances as the first
argument to warnings.warn. In this case the category argument
will be ignored. The message text used will be str(warninginstance).
2002-03-21 10:38:40 +00:00