Commit Graph

57 Commits

Author SHA1 Message Date
George Yoshida 159a1160c1 At first there were 6 steps, but one was removed after that. 2006-05-12 16:40:11 +00:00
Nick Coghlan afd5e63e24 Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager() 2006-05-03 13:02:47 +00:00
Guido van Rossum da5b701aee Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
2006-05-02 19:47:52 +00:00
Georg Brandl 3c1983face Patch #1479438: add \keyword markup for "with". 2006-04-30 19:34:19 +00:00
Nick Coghlan a7e820a408 Move the PEP 343 documentation and implementation closer to the
terminology in the alpha 1 documentation.

 - "context manager" reverts to its alpha 1 definition
 - the term "context specifier" goes away entirely
 - contextlib.GeneratorContextManager is renamed GeneratorContext

There are still a number of changes relative to alpha 1:

  - the expression in the with statement is explicitly called the
    "context expression" in the language reference
  - the terms 'with statement context', 'context object' or 'with
    statement context' are used in several places instead of a bare
    'context'. The aim of this is to avoid ambiguity in relation to the
    runtime context set up when the block is executed, and the context
    objects that already exist in various application domains (such as
    decimal.Context)
  - contextlib.contextmanager is renamed to contextfactory
    This best reflects the nature of the function resulting from the
    use of that decorator
  - decimal.ContextManager is renamed to WithStatementContext
    Simple dropping the 'Manager' part wasn't possible due to the
    fact that decimal.Context already exists and means something
    different. WithStatementContext is ugly but workable.

A technically unrelated change snuck into this commit:
contextlib.closing now avoids the overhead of creating a
generator, since it's trivial to implement that particular
context manager directly.
2006-04-25 10:56:51 +00:00
Nick Coghlan 877cf234c9 Change PEP 343 related documentation to use the term context specifier instead of context object 2006-04-24 04:17:02 +00:00
Nick Coghlan fee3dfc061 Update with statement documentation to use same terminology as 2.5a1 implementation 2006-04-23 15:39:16 +00:00
Neal Norwitz d03b073e9b Add version added info for with statement and context managers 2006-03-28 05:51:02 +00:00
Phillip J. Eby 16e86da730 The "with" statement needs a __future__. :) 2006-03-27 21:42:30 +00:00
Phillip J. Eby 075ef1ac1b Document the "with" statement. 2006-03-27 21:06:13 +00:00
Guido van Rossum c2e20744b2 PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).

This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.

There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
2006-02-27 22:32:47 +00:00
Neal Norwitz 11ca77e6de Doc for PEP 341, needs improvement 2005-12-17 22:24:12 +00:00
Michael W. Hudson 2f475a7bc8 Fix:
[ 1207501 ] Issue in grammar

We didn't define dotted_name in the pseudo-grammar in the reference
docs.  Backport candidate.
2005-05-26 07:58:22 +00:00
Brett Cannon 629496b77c Add grammar change for allowing ``class B(): pass`` syntax. 2005-04-09 03:03:00 +00:00
Michael W. Hudson a2a9888f22 Updates to the exceptions documentation (this is my patch #1156102). 2005-03-04 14:33:32 +00:00
Fred Drake 7fabaf8375 clarify discussion of iteration in the section on the "for" statement
(SF bug #829073)
2004-11-02 19:18:20 +00:00
Fred Drake 9a40851569 clarify trailing comma in function argument list
(SF bug #798652)
2004-11-02 18:57:33 +00:00
Michael W. Hudson 0ccff074cd This is Mark Russell's patch:
[ 1009560 ] Fix @decorator evaluation order

From the description:

Changes in this patch:

- Change Grammar/Grammar to require
newlines between adjacent decorators.

- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers

- Add better order of evaluation check
to test_decorators.py (test_eval_order)

- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)

and the comment:

Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)

(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
2004-08-17 17:29:16 +00:00
Anthony Baxter c2a5a63654 PEP-0318, @decorator-style. In Guido's words:
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.
2004-08-02 06:10:11 +00:00
Martin v. Löwis 9c322fbe36 The expression list in inheritance is not optional. Fixes #960448.
Will backport to 2.3.
2004-06-02 12:59:59 +00:00
Fred Drake 2348afd3f8 - update to reflect that base classes can be class types as well as
"classic" class objects
  [partially fixes SF bug #453684]

- add note that new-style classes can use descriptors to implement
  instance variables in different ways
2003-09-24 04:11:47 +00:00
Raymond Hettinger c7a26562f9 SF patch#786531 'the the' typo. Contributed by George Yoshida 2003-08-12 00:01:17 +00:00
Fred Drake 78eb200758 Added cross-references to related material on exceptions.
Closes SF bug #217195.

Make sure section numbers wrap together with the preceeding word
("section").
2002-10-18 15:20:32 +00:00
Jeremy Hylton 88955cbe1f Change reference to execframes to naming. 2002-04-01 21:34:28 +00:00
Jeremy Hylton 1824b59e89 Update programmer's note on nested functions. 2002-04-01 21:30:15 +00:00
Fred Drake 5381588073 Revise the markup related to the grammar productions to increase the
level of predictability.  This is not really "good" markup, but is arguably
better than we had before.
This closes SF bug #523117.
2002-03-15 23:21:37 +00:00
Fred Drake 216cbca195 Typo: thsi -> this. Closes SF bug #521450. 2002-02-22 15:40:23 +00:00
Fred Drake 687bde9433 Added some missing index entries, noted by L. Peter Deutsch.
This should be included in Python 2.2.1.
2001-12-27 18:38:10 +00:00
Fred Drake 0aa811c527 Use the \note and \warning macros where appropriate. 2001-10-20 04:24:09 +00:00
Fred Drake cb4638a278 Change the grammar productions to use the new productionlist environment;
this supports a hyperlinked version of the grammar that can make tracking
down details and definitions a little easier.
2001-07-06 22:49:53 +00:00
Fred Drake 93852ef3c8 Fix minor markup nits. 2001-06-23 06:06:52 +00:00
Fred Drake 2829f1cf99 Fix a very minor (but annoying when looking for things!) markup nit. 2001-06-23 05:27:20 +00:00
Fred Drake 7c116d7acb Fix typo reported by David Goodger. This closes SF patch #422383. 2001-05-10 15:09:36 +00:00
Jeremy Hylton aa90adcfb9 Add nested scopes spec to appendix.
Add new opcodes LOAD_CLOSURE, LOAD_DEREF, STORE_DEREF, MAKE_CLOSURE to
docs for dis module.

Add docs for new function and code members in Sec. 3 of ref manual.
They're present regardless of whether nested scopes are used.

Remove description of default argument hack from Sec. 7 of the ref
manual and refer the reader to the appendix.
2001-03-23 17:23:50 +00:00
Jeremy Hylton 3faa52ecc4 Allow 'continue' inside 'try' clause
SF patch 102989 by Thomas Wouters
2001-02-01 22:48:12 +00:00
Fred Drake 2cba0f641f Improve description of else clause of the try/except/else statement.
This closes (again!) bug #127098.
2001-01-02 19:22:48 +00:00
Thomas Wouters 8e2b6b5cc7 Change documentation of 'else' clause of 'try/except' to make clear that it
doesn't get triggered by 'return', 'break' or 'continue'. If the
'try-inside-continue' patch does not get accepted before next release, the
'or continue' should be removed ;P

Closes SF patch #103045 and SF bug #127098.
2000-12-31 22:52:59 +00:00
Thomas Wouters f9b526dbfd More of Rob W. W. Hooft's spelling fixes. The only ones left now are the
distutils patches, which I'll leave to the distutils maintainers.

Tip: review the patch like this:

grep "^[\!+-] " <patchfile>

To get a quick and easy way to review the actual changes. Most of the
changes are single-line ones, anyway.
2000-07-16 19:05:38 +00:00
Fred Drake e15956b465 Merged changes from the 1.5.2p2 release. 2000-04-03 04:51:13 +00:00
Fred Drake 4c2533fe3c Added sentence "All exceptions must have an executable block."; from
Dan Wolfe <wolfeman@apple.com>.
1999-08-24 22:14:01 +00:00
Fred Drake b55ce1e8b6 Fixed latex2html weirdness with footnotes. 1999-04-05 21:32:52 +00:00
Fred Drake 99cd5735f0 Minor markup nits. 1999-02-12 20:40:09 +00:00
Guido van Rossum e039439e3b Clarify evaluation of default arguments at def time with more text and
an example.
1998-12-04 19:37:10 +00:00
Fred Drake 1475e88a35 Minor fixups to some index entries. 1998-11-25 17:48:10 +00:00
Fred Drake 61c7728cc9 Make sure all chapters, sections, and subsections have a \label to give them
semantic file names in the HTML.  No more node#.html files!
1998-07-28 19:34:22 +00:00
Guido van Rossum 5399d68c4b Changes copied from the FrameMaker version. Not too much. 1998-07-24 18:51:11 +00:00
Fred Drake 5c07d9b028 Updated markup style (got rid of \verb@...@, mostly). 1998-05-14 19:37:06 +00:00
Fred Drake f666917ab7 The Python Reference Manual. 1998-05-06 19:52:49 +00:00
Guido van Rossum 1f17543ee7 Removed LaTeX version of reference manual. Added ref/ref.ps. 1996-10-22 20:00:02 +00:00
Guido van Rossum 00ed6a3279 added '**kw' to parameter list syntax 1996-06-26 19:26:20 +00:00