Commit Graph

479 Commits

Author SHA1 Message Date
Fred Drake 5e30626f7f SF patch #1303595: improve description of __builtins__, explaining how it
varies between __main__ and other modules, and strongly suggest not touching
it but using __builtin__ if absolutely necessary
2006-06-10 20:01:34 +00:00
George Yoshida 3689571425 End of Ch.3 is now about "with statement".
Avoid obsolescence by directly referring to the section.
2006-05-27 16:51:43 +00:00
George Yoshida 5e0b88200e minor markup nits 2006-05-27 16:32:44 +00:00
Georg Brandl a89dbec257 Patch #1492218: document None being a constant. 2006-05-26 20:14:47 +00:00
George Yoshida c120a6d897 Fix the TeX compile error. 2006-05-21 04:22:59 +00:00
George Yoshida 5c6a5ecddf - Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
2006-05-20 16:29:14 +00:00
George Yoshida 6fffa5e865 - markup fix
- add clarifying words
2006-05-20 15:36:19 +00:00
George Yoshida 8f505aed46 Duplicated description about the illegal continue usage can be found in nearly the same place.
They are same, so keep the original one and remove the later-added one.
2006-05-12 17:25:26 +00:00
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
Fred Drake 2de7a35e9a one more place to avoid extra markup 2006-05-03 02:27:40 +00:00
Fred Drake f25fa6ddb9 avoid ugly markup based on the unfortunate conversions of ">>" and "<<" to
guillemets; no need for magic here
2006-05-03 02:04:40 +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
George Yoshida a1d3b1011e wrap SyntaxError with \exception{} 2006-04-23 09:27:10 +00:00
Georg Brandl e071b001ca bug #1462278: small fix in documentation of __op__ vs __rop__ methods 2006-04-01 07:23:08 +00:00
Georg Brandl 76a2caebed typos 2006-03-31 16:12:34 +00:00
Georg Brandl 4c974989d7 Add index entries for new-style/old-style class. 2006-03-31 15:12: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
Phillip J. Eby 5d0f4c6193 Document the PEP 343 context manager protocol methods. 2006-03-27 19:59:34 +00:00
Phillip J. Eby 1a9fac0937 Yield is now allowed in try-finally, so update docs accordingly 2006-03-25 00:46:43 +00:00
Guido van Rossum 38fff8c4e4 Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
2006-03-07 18:50:55 +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 f9f61b4aa2 Note version added for conditional expressions 2006-02-27 16:31:12 +00:00
Thomas Wouters dca3b9c797 PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as
two new grammar rules for backward compatibility. If no one else fixes
parsermodule, I guess I'll go ahead and fix it later this week.

The TeX code was checked with texcheck.py, but not rendered. There is
actually a slight incompatibility:

>>> (x for x in lambda:0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iteration over non-sequence

changes into

>>> (x for x in lambda: 0)
  File "<stdin>", line 1
    (x for x in lambda: 0)
                     ^
SyntaxError: invalid syntax

Since there's no way the former version can be useful, it's probably a
bugfix ;)
2006-02-27 00:24:13 +00:00
Fredrik Lundh 5a49fae1ab SF patch #1421726
fixed typo in language reference
2006-02-02 21:58:55 +00:00
Georg Brandl 5f0ff5c8e7 Add markup to a "Python Standard Library" doc reference I added for bug 839585. 2006-01-20 17:51:37 +00:00
Georg Brandl a635fbbcb0 Remove dots in \version{changed,added} argument and
correct argument order.
2006-01-15 07:55:35 +00:00
Georg Brandl c47f1c194a Bug #839585: mention % string operator in language ref 2005-12-26 23:15:48 +00:00
Armin Rigo ddddd2f7e6 Updating the short blob about old/new-style classes to reflect (IMHO) more
precisely the motivation and the differences.

Added links to www.python.org/doc/newstyle.html and a footnote to warn against
the statement "x[i] is equivalent to x.__getitem__(i)", which already caused
many invalid bug reports on SF.
2005-12-26 18:06:17 +00:00
Neal Norwitz 11ca77e6de Doc for PEP 341, needs improvement 2005-12-17 22:24:12 +00:00
Andrew M. Kuchling 6af5239501 Add placeholder section on old and new-style classes 2005-12-04 16:07:15 +00:00
Georg Brandl f96f5f5bbe Bug #1359053: Doc: \Uxxxxxxxx escapes _are_ interpreted in raw unicode strings 2005-11-22 19:23:58 +00:00
Martin v. Löwis ab0f947a21 Remove .cvsignore files, as they live in svn:ignore
properties now.
2005-10-30 22:01:41 +00:00
Fred Drake 59c61911ac add missing "and" 2005-10-30 04:29:49 +00:00
Neal Norwitz c0d11250af Make close brace a paren to match open. 2005-10-04 03:43:43 +00:00
Neal Norwitz 19f6b86955 Armin caught this mistake in bug #973103. 2005-10-04 03:37:29 +00:00
Raymond Hettinger bee0d467a1 Correct docs for empty raise when no exception is active. 2005-10-03 16:39:51 +00:00
Georg Brandl d430726b82 Better wording for integer ref entry. 2005-09-12 12:49:38 +00:00
Fred Drake b6e1c11004 note that the return and yield statements cannot be used at the top level in
exec statements; people coming from certain other languages seem to be
confused by this on a regular basis
2005-09-07 05:17:07 +00:00
Fred Drake b3dfc0ae5e - fix typo report by email, only 1.5 years late
- fix several consistency nits relating to \method{...()}
2005-09-07 04:57:56 +00:00
Georg Brandl 7da4edac28 Clarify what is meant with "whole numbers". 2005-09-04 18:30:19 +00:00
Georg Brandl 15ad935568 __new__ is a static method 2005-08-26 12:56:22 +00:00
Georg Brandl 8fc18a2010 bug [ 1261229 ] __new__ is class method 2005-08-25 21:56:45 +00:00
Georg Brandl 6cd5377c72 Empty sets and frozensets are also false. 2005-08-21 12:22:58 +00:00