Commit Graph

203 Commits

Author SHA1 Message Date
Nick Coghlan d8accb32a5 Get rid of a couple more context object references, fix some markup and clarify what happens when a generator context function swallows an exception. 2006-05-03 13:17:49 +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 4b8ec63114 add missing word 2006-04-27 00:20:14 +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 84faa85775 Add a Context Types section to parallel the Iterator Types section (uses the same terminology as the 2.5a1 implementation) 2006-04-23 15:13:32 +00:00
Georg Brandl 275935db8d document sys.maxint in std objects 2006-03-28 18:02:44 +00:00
Phillip J. Eby 168e99f6db Document objects that can be used with the ``with`` statement. 2006-03-28 00:13:10 +00:00
Neal Norwitz 6a91e94e66 SF bug # 1457358 and patch # 1458419, floor division not documented. Patch by Andy.
Will backport.
2006-03-25 21:25:30 +00:00
Georg Brandl db815abc70 More \exception fixes. 2006-03-17 16:26:31 +00:00
Guido van Rossum 1968ad32cd - Patch 1433928:
- The copy module now "copies" function objects (as atomic objects).
  - dict.__getitem__ now looks for a __missing__ hook before raising
    KeyError.
  - Added a new type, defaultdict, to the collections module.
    This uses the new __missing__ hook behavior added to dict (see above).
2006-02-25 22:38:04 +00:00
Georg Brandl 1dc5a84aee Bug #801349: document that start/stop/step slice arguments can be None 2006-02-19 00:12:42 +00:00
Georg Brandl a3a93ae7c8 Bug #1396471: Document that Windows' ftell() can return invalid
values for text files with UNIX-style line endings.
2006-01-20 09:14:36 +00:00
Georg Brandl 0f194234dc Bug #1394868: doc typos 2006-01-01 21:35:20 +00:00
Georg Brandl 75400db251 Bug #1389673: document correct return value of set methods 2005-12-26 23:55:56 +00:00
Georg Brandl 6ee339109f Remove reference to the "t" open() mode as it is platform dependent. 2005-12-15 21:34:29 +00:00
Walter Dörwald d4bfe2c878 SF patch #1364946: Add a reference link from the dcoumentation of the encode
and decode methods to the documentation of the default error handlers.
2005-11-25 17:17:12 +00:00
Fred Drake 4094d04457 fix link to subsection (SF bug #1311674) 2005-10-03 14:25:40 +00:00
Raymond Hettinger 1a663911d2 Fix markup. 2005-08-18 21:27:11 +00:00
Georg Brandl 290f3829d7 Revert patch for 1162912. 2005-07-04 14:17:47 +00:00
Georg Brandl f73b4b0077 bug [ 1162912 ] typesseq-mutable lacks note on combined key/cmp usage 2005-07-03 20:21:40 +00:00
Raymond Hettinger 452b6834f0 Cross reference the set built-ins with the sets module. 2005-07-01 23:18:36 +00:00
Raymond Hettinger 24d7521985 SF bug #1215887: String and list methods documentation deeply hidden
Make doc on specific types easier to find by listing them in the headings
for the abstract types.
2005-06-14 08:45:43 +00:00
Raymond Hettinger dede3bdfa1 SF bug #1209411: divmod documentation shd reference // not / 2005-05-31 11:04:00 +00:00
Raymond Hettinger 7bebbe7673 SF bug #1202395: Description of string.lstrip() needs improvement
Clarify the role of the chars argument in the strip() methods.
2005-05-31 10:26:28 +00:00
Raymond Hettinger 631bfe602f SF bug #1209671: dict.popitem documentation should mention empty dict case 2005-05-27 10:43:55 +00:00
Raymond Hettinger 87bd3fe266 Correct swapped descriptions of empty string splits. 2005-04-19 04:29:44 +00:00
Raymond Hettinger e490502e04 SF bug #1179957: Missing def'n of equality for set elements 2005-04-10 17:32:35 +00:00
Raymond Hettinger 4e9907c914 SF bug #1119700: list extend() accepts args besides lists 2005-02-09 23:19:25 +00:00
Raymond Hettinger bc029af436 SF bug #1108303: fix .split() maxsplit doc
Docs incorrectly stated that maxsplit=0 would cause unlimited splitting.
2005-01-26 22:40:08 +00:00
Raymond Hettinger 770184b365 SF bug #1105286: Undocumented implicit strip() in split(None) string method
Clarify the behavior when a string begins or ends with whitespace.
2005-01-25 10:21:19 +00:00
Raymond Hettinger 68804315e0 SF Patch #1093896: miscellaneous doc typos 2005-01-01 00:28:46 +00:00
Raymond Hettinger 5d6057f073 Fix typo. 2004-12-02 08:31:41 +00:00
Raymond Hettinger 23ce5848aa Clarify the ordering of dictionary keys. 2004-11-25 05:16:19 +00:00
Fred Drake 2269d86598 Fix SF bug #1061770: Manual typesets bit-shift operators as guillemet 2004-11-11 06:14:05 +00:00
Armin Rigo 80adba6873 Mistakes in the "sequence types" page:
* explanation for example with lists of lists made confusing use of
  the word "contains" to mean "is built out of".

* wrong formula for slices with step.  Is it ok to use LaTeX formulas
  (which become images in the html document)?  This version needs one
  because it's based on a fraction.  Just writing "\code{(j-i)/k}" here would
  be ambiguous because it looks like a rounding-down-to-the-previous-integer
  division, which is not what we need here.  Of course we could write
  "\code{float(j-i)/k}" but it just looks confusing.
2004-11-04 11:29:09 +00:00
Raymond Hettinger 77d110d6b8 SF patch #1041364: True/False instead of 1/0 in libstdtypes.tex
(Contributed by Gerrit Holl.  Reviewed by Jeff Epler.)
2004-10-08 01:52:15 +00:00
Andrew M. Kuchling 55be9eab38 Typo fix: 'comparisions' is not a word 2004-09-10 12:59:54 +00:00
Raymond Hettinger bb30af4565 Add missing close parenthesis. 2004-09-06 00:42:14 +00:00
Raymond Hettinger 18c6960964 SF bug #901654: split method documentation can be improved
* Discuss the algorithmic distinctions between s.split() and s.split(sep).
* Document the split behavior for empty strings.
* Note the behavior when maxsplit is zero.
* Include short examples.
2004-09-06 00:12:04 +00:00
Michael W. Hudson 5e897959db This is my patch
[ 1004703 ] Make func_name writable

plus fixing a couple of nits in the documentation changes spotted by MvL
and a Misc/NEWS entry.
2004-08-12 18:12:44 +00:00
Michael W. Hudson 049e7aaa0f Point out that the setdefault defaults the value to None. Inspired by
Michael Chermside's thinking about patch #748126 (the chief upshot of
which thinking was "reject it!").
2004-08-07 16:41:34 +00:00
Andrew M. Kuchling 34ed2b020a Typo fix; use 'in-place' instead of 'inplace' 2004-08-06 18:55:09 +00:00
Raymond Hettinger 52a21b8e65 SF patch #980695: efficient string concatenation
(Original patch by Armin Rigo).
2004-08-06 18:43:09 +00:00
Hye-Shik Chang e9ddfbb412 SF #989185: Drop unicode.iswide() and unicode.width() and add
unicodedata.east_asian_width().  You can still implement your own
simple width() function using it like this:
    def width(u):
        w = 0
        for c in unicodedata.normalize('NFC', u):
            cwidth = unicodedata.east_asian_width(c)
            if cwidth in ('W', 'F'): w += 2
            else: w += 1
        return w
2004-08-04 07:38:35 +00:00
Raymond Hettinger cab5b94592 SF bug #995983 and #995987: Documentation nits. 2004-07-22 19:33:53 +00:00
Walter Dörwald ac1075a645 Document that encode() and decode() raise UnicodeError
instead of ValueError.

Add a note about error handling schemes added by PEP 293.
2004-07-01 19:58:47 +00:00
Skip Montanaro ecf7a52bb8 link to the codecs page from the "".encode() description. 2004-07-01 19:26:04 +00:00
Martin v. Löwis 4a9b8069e0 Document string methods that are locale-dependent. Fixes #935749.
Will backport to 2.3.
2004-06-03 09:47:01 +00:00
Hye-Shik Chang 974ed7cfa5 - SF #962502: Add two more methods for unicode type; width() and
iswide() for east asian width manipulation. (Inspired by David
Goodger, Reviewed by Martin v. Loewis)
- Move _PyUnicode_TypeRecord.flags to the end of the struct so that
no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)
2004-06-02 16:49:17 +00:00