Commit Graph

148 Commits

Author SHA1 Message Date
Raymond Hettinger 74923d73ee SF bug #560286: Add docs for 'basestring' 2003-09-09 01:12:18 +00:00
Raymond Hettinger 99812134be SF bug 799191: fix markup 2003-09-06 05:47:31 +00:00
Raymond Hettinger 999b57c872 Fix double word typos. 2003-08-25 04:28:05 +00:00
Raymond Hettinger f17d65da3a SF patch#786531 'the the' typo. Contributed by George Yoshida 2003-08-12 00:01:16 +00:00
Raymond Hettinger eaef615116 As discussed on python-dev, changed builtin.zip() to handle zero arguments
by returning an empty list instead of raising a TypeError.
2003-08-02 07:42:57 +00:00
Neal Norwitz b25229d823 Fix SF bug #766288, property() example gives syntax error 2003-07-05 17:37:58 +00:00
Raymond Hettinger 774816f817 SF bug #764616: execfile(filename,...) not execfile(file,...)
Clarify parameter name.
2003-07-02 15:31:54 +00:00
Fred Drake 2884d6de15 Fix a variety of small markup nits. 2003-07-02 12:27:43 +00:00
Fred Drake 3ede7848a9 - note that super() only applies to new-style classes;
closes SF bug #764003
- fix markup for consistency
2003-07-01 16:31:26 +00:00
Fred Drake f91888bb46 markup consistency nits 2003-06-26 03:11:57 +00:00
Raymond Hettinger 2b9bc08ee7 Removed useless intra-section references which jump to the top of the
section instead of the specific item being referenced.
2003-06-25 20:36:20 +00:00
Neal Norwitz 938b7a0f63 Fix some markup nits 2003-06-17 02:37:06 +00:00
Raymond Hettinger 7e902b27e0 * Added missing documentation for object().
* Noted the Py2.3 in the optional arg for bool().
2003-06-11 09:15:26 +00:00
Raymond Hettinger 3985df2c99 SF bug #660022: parameters for int(), str(), etc.
* Indicate that arguments are optional for most builtin type constructors.
* Replace e.g. in staticmethod() and classmethod() docs.
* Add \code{} markup to some in-line code examples.
2003-06-11 08:16:06 +00:00
Raymond Hettinger 80b3f685b4 SF bug: 751941 Invisible HTML tag
Added missing jump target labels.
2003-06-10 21:41:22 +00:00
Martin v. Löwis 7472336444 Patch #744877: Explain filter in terms of list comprehension. Remove
explanation of int in terms of string.atoi. Explain sum in terms of
reduce.
2003-05-31 08:02:38 +00:00
Fred Drake 8f53cdcfce - object is a class type, not a function
- when marking a function, the trailing () should be included
  consistently
2003-05-10 19:46:39 +00:00
Raymond Hettinger 0dfd7a9361 Missing parenthesis found by texcheck.py 2003-05-10 07:40:56 +00:00
Fred Drake 282be3ab89 - explain the start argument to sum()
- various adjustments to sum() markup and explanation
2003-04-22 14:52:08 +00:00
Alex Martelli a70b19147f Adding new built-in function sum, with docs and tests. 2003-04-22 08:12:33 +00:00
Walter Dörwald 2e0b18af30 Change the treatment of positions returned by PEP293
error handers in the Unicode codecs: Negative
positions are treated as being relative to the end of
the input and out of bounds positions result in an
IndexError.

Also update the PEP and include an explanation of
this in the documentation for codecs.register_error.

Fixes a small bug in iconv_codecs: if the position
from the callback is negative *add* it to the size
instead of substracting it.

From SF patch #677429.
2003-01-31 17:19:08 +00:00
Raymond Hettinger 69bf8f3f4e SF bug #655271: Slightly modify locals() doc
Clarify the operation of locals().
2003-01-04 02:16:22 +00:00
Fred Drake 45e482fd3d Document that apply() is deprecated. See:
http://mail.python.org/pipermail/python-dev/2003-January/031556.html
2003-01-02 04:54:04 +00:00
Neal Norwitz 046b8a7244 Fix SF # 641111, Undocumented side effect of eval
Try to clear up confusion about the current globals being copied
into a globals dict passed to eval().  This wording (more or less)
was suggested in bug report.  It should probably be made clearer.

Backport candidate.
2002-12-17 01:08:06 +00:00
Neal Norwitz e9ce25e512 Fix SF #642742, property() builtin not documented
Added doc for functions new to 2.2:  classmethod property staticmethod super
Taken from docstrings.  Could use review.
Hope there wasn't a reason why these shouldn't have been added.

Backport candidate.
2002-12-17 01:02:57 +00:00
Walter Dörwald d9a6ad3beb Enhance issubclass() and PyObject_IsSubclass() so that a tuple is
supported as the second argument. This has the same meaning as
for isinstance(), i.e. issubclass(X, (A, B)) is equivalent
to issubclass(X, A) or issubclass(X, B). Compared to isinstance(),
this patch does not search the tuple recursively for classes, i.e.
any entry in the tuple that is not a class, will result in a
TypeError.

This closes SF patch #649608.
2002-12-12 16:41:44 +00:00
Fred Drake 6e596b6895 Added change note about returning a dictionary based on keyword
arguments.
2002-11-23 15:02:13 +00:00
Just van Rossum a797d8150d Patch #642500 with slight modifications: allow keyword arguments in
dict() constructor. Example:
  >>> dict(a=1, b=2)
  {'a': 1, 'b': 2}
  >>>
2002-11-23 09:45:04 +00:00
Walter Dörwald f171540ab8 Change int() so that passing a string, unicode, float or long argument
that is outside the integer range no longer raises OverflowError, but
returns a long object instead.

This fixes SF bug http://www.python.org/sf/635115
2002-11-19 20:49:15 +00:00
Fred Drake 9482d2591a Update example for the type() function to use the currently accepted
preference of using "is" instead of "==" to compare types, use
built-in names where available, and point to the isinstance()
function.
Closes SF bug #632196.
2002-11-01 21:33:44 +00:00
Fred Drake d6cf8bea0a Modify example to use string methods instead of the string module. 2002-10-22 20:31:22 +00:00
Fred Drake 3e930ba55f Another try at clarifying what goes into and comes out of Unicode objects. 2002-09-24 21:08:37 +00:00
Fred Drake 7b788e0582 Clarify that len() of a Unicode string returns the number of storage units,
not abstract characters.
2002-09-24 13:57:21 +00:00
Raymond Hettinger d918884bb8 Fix typo 2002-09-04 23:52:42 +00:00
Fred Drake 5ec486b87a Add a note that apply() is needed since the extended call syntax is
completely equivalent.
2002-08-22 14:27:35 +00:00
Guido van Rossum 45ec02aed1 SF patch 576101, by Oren Tirosh: alternative implementation of
interning.  I modified Oren's patch significantly, but the basic idea
and most of the implementation is unchanged.  Interned strings created
with PyString_InternInPlace() are now mortal, and you must keep a
reference to the resulting string around; use the new function
PyString_InternImmortal() to create immortal interned strings.
2002-08-19 21:43:18 +00:00
Fred Drake 2095b9690f reduce(): Clarified what is returned in the case of a sequence 1 item long and
initial/default value.
2002-07-17 13:55:33 +00:00
Fred Drake 4254cbd29c Note that unicode() can raise LookupError for unknown codecs.
Closes SF bug #513666.
2002-07-09 05:25:46 +00:00
Fred Drake 50e1286c00 Fix typo: "an Unicode string" --> "a Unicode string"
Clarify the return value when the parameter is a Unicode object.
2002-07-08 14:29:05 +00:00
Fred Drake 78e057a32a Clarify the version information for the unicode() built-in.
Closes SF bug #575272.
2002-06-29 16:06:47 +00:00
Fred Drake 807354f3b6 Add a note that divmod() with complex numbers is deprecated. 2002-06-20 21:10:25 +00:00
Barry Warsaw 177b4a065f Jack's documentation for the U mode character on the file()
constructor, vetted by Barry.
2002-05-22 20:39:43 +00:00
Raymond Hettinger 6cf09f0792 Patch 543387. Document deprecation of complex %, //,and divmod(). 2002-05-21 18:19:49 +00:00
Fred Drake 38f71973e5 Documentation for the enumerate() function/type.
This closes SF patch #547162.
2002-04-26 20:29:44 +00:00
Fred Drake 933f159a2f Add a version annotation for the help() function. 2002-04-17 12:54:04 +00:00
Guido van Rossum 77f6a65eb0 Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285.  Everything described in the PEP is here, and there is even
some documentation.  I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison.  I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.

Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
2002-04-03 22:41:51 +00:00
Fred Drake da8a6dd072 Added missing version annotation for dict(). 2002-03-06 02:29:30 +00:00
Tim Peters 9f4341b3b0 SF bug #501591: dir() doc is old
Bugfix candidate.

+ Updated dir() description to match actual 2.2 behavior.

+ Replaced the dir(sys) example with dir(struct), because the former
  was way out of date and is bound to change frequently, while the
  latter is stable.

+ Added a note cautioning that dir() is supplied primarily for
  convenience at an interactive prompt (hoping to discourage its
  use as the foundation of introspective code outside the core).
2002-02-23 04:40:15 +00:00
Fred Drake 732299ff63 Add documentation for the help() built-in; contributed by Ka-Ping Yee.
This is part of SF patch #494622.
2001-12-18 16:31:08 +00:00
Fred Drake 526c7a0101 Ensure that complex() only accepts a string argument as the first arg,
and only if there is no second arg.
This closes SF patch #479551.
2001-12-13 19:52:22 +00:00