Commit Graph

30384 Commits

Author SHA1 Message Date
Fred Drake 69013d070e - document the termination condition for cmd.Cmd.cmdloop()
- document the use of the return value for cmd.Cmd.do_*() methods
2004-07-30 18:58:54 +00:00
Martin v. Löwis 479b7a7cdb Fix typo. 2004-07-30 16:09:19 +00:00
Martin v. Löwis 8ddb638e43 Add closing methoddesc. Add versionadded. Rewrap. 2004-07-30 16:08:49 +00:00
Armin Rigo 1dd04a02e0 This is a reorganization of list_ass_slice(). It should probably be reviewed,
though I tried to be very careful.  This is a slight simplification, and it
adds a new feature: a small stack-allocated "recycled" array for the cases
when we don't remove too many items.

It allows PyList_SetSlice() to never fail if:
* you are sure that the object is a list; and
* you either do not remove more than 8 items, or clear the list.

This makes a number of other places in the source code correct again -- there
are some places that delete a single item without checking for MemoryErrors
raised by PyList_SetSlice(), or that clear the whole list, and sometimes the
context doesn't allow an error to be propagated.
2004-07-30 11:38:22 +00:00
Armin Rigo a37bbf2e5b What if you call lst.__init__() while it is being sorted? :-)
The invariant checks would break.
2004-07-30 11:20:18 +00:00
Raymond Hettinger c0aaa2db4f * Simplify and speed-up list_resize(). Relying on the newly documented
invariants allows the ob_item != NULL check to be replaced with an
  assertion.

* Added assertions to list_init() which document and verify that the
  tp_new slot establishes the invariants.  This may preclude a future
  bug if a custom tp_new slot is written.
2004-07-29 23:31:29 +00:00
Armin Rigo 93677f075d * drop the unreasonable list invariant that ob_item should never come back
to NULL during the lifetime of the object.

* listobject.c nevertheless did not conform to the other invariants,
  either; fixed.

* listobject.c now uses list_clear() as the obvious internal way to clear
  a list, instead of abusing list_ass_slice() for that.  It makes it easier
  to enforce the invariant about ob_item == NULL.

* listsort() sets allocated to -1 during sort; any mutation will set it
  to a value >= 0, so it is a safe way to detect mutation.  A negative
  value for allocated does not cause a problem elsewhere currently.
  test_sort.py has a new test for this fix.

* listsort() leak: if items were added to the list during the sort, AND if
  these items had a __del__ that puts still more stuff into the list,
  then this more stuff (and the PyObject** array to hold them) were
  overridden at the end of listsort() and never released.
2004-07-29 12:40:23 +00:00
Armin Rigo f414fc4004 Minor memory leak. 2004-07-29 10:56:55 +00:00
Vinay Sajip e12f71586a Ignore exceptions which occur when closing files in shutdown() 2004-07-29 09:19:30 +00:00
Raymond Hettinger f9fd0d7988 SF bug #997533: "disjunct" should be "disjoint"
* Use plain wording in docs for id().
* Use normal quotation marks instead of single quotes in the description.
2004-07-29 06:06:34 +00:00
Tim Peters 51b4ade306 Fix obscure breakage (relative to 2.3) in listsort: the test for list
mutation during list.sort() used to rely on that listobject.c always
NULL'ed ob_item when ob_size fell to 0.  That's no longer true, so the
test for list mutation during a sort is no longer reliable.  Changed the
test to rely instead on that listobject.c now never NULLs-out ob_item
after (if ever) ob_item gets a non-NULL value.  This new assumption is
also documented now, as a required invariant in listobject.h.

The new assumption allowed some real simplification to some of the
hairier code in listsort(), so is a Good Thing on that count.
2004-07-29 04:07:15 +00:00
Neal Norwitz 014f103705 SF bug #999776, zlib home page wrong
Backport candidate.
2004-07-29 03:55:56 +00:00
Neal Norwitz f9f0b21653 SF #998170, fix typo. Backport candidate 2004-07-29 03:48:59 +00:00
Tim Peters a995a2dd54 Document what the members of PyListObject are used for, and the crucial
invariants they must satisfy.
2004-07-29 03:29:15 +00:00
Tim Peters b38e2b61b3 Trimmed trailing whitespace. 2004-07-29 02:29:26 +00:00
Tim Peters 3986d4e660 PyList_New(): we went to all the trouble of computing and bounds-checking
the size_t nbytes, and passed nbytes to malloc, so it was confusing to
effectively recompute the same thing from scratch in the memset call.
2004-07-29 02:28:42 +00:00
Skip Montanaro 6d3db7000e Add missing doc for Py_True/Py_False. Use the correct macro to define
Py_RETURN_FALSE and Py_RETURN_TRUE.
2004-07-29 02:16:04 +00:00
Thomas Heller a18331de4e Use PyMODINIT_FUNC. 2004-07-28 20:02:52 +00:00
Marc-André Lemburg 17b6d28c64 New codec: [ 996067 ] hp-roman8 codec 2004-07-28 15:37:54 +00:00
Marc-André Lemburg cd8a4cb3d3 Added new codec hp-roman8 submitted as patch [ 996067 ] hp-roman8 codec. 2004-07-28 15:35:29 +00:00
Andrew M. Kuchling 671c506737 Add new encodings 2004-07-28 15:29:39 +00:00
Fred Drake 25d88926b9 Since build_py handles package data installation, the list of outputs
can contain more than just .py files.  Make sure we only report
bytecode files for the .py files.
2004-07-28 14:55:10 +00:00
Skip Montanaro 33ee76ae9e A little boolean music if you please, maestro... (Not sure I have the
versionadded{} args quite right).
2004-07-28 14:17:04 +00:00
Hye-Shik Chang efdc16ffbb Remove unused source file from Windows project files. 2004-07-28 09:45:20 +00:00
Hye-Shik Chang 978d26256b Add missing _codecs_iso2022 module of cjkcodecs. I'll add unittest
for it soon.
2004-07-28 09:39:54 +00:00
Hye-Shik Chang eb34110190 Remove CJKCodecs implementation of UTF-7 and UTF-8 codec which
aren't intended to be part of Python distributiuon.  This was
accidently imported on mass converting from standalone version of
CJKCodecs.
2004-07-28 09:36:52 +00:00
Neal Norwitz bee417439e Add versionadded info 2004-07-28 02:34:12 +00:00
Tim Peters 49667c257b Ack, removed useless import of os I just introduced. 2004-07-27 21:05:21 +00:00
Tim Peters 5cfb05eef0 Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
2004-07-27 21:02:02 +00:00
Martin v. Löwis fe393f47c6 Use intptr_t/uintptr_t on Windows 2004-07-27 15:57:24 +00:00
Martin v. Löwis b600fe90a7 Switch arguments to memset (kudos to MSVC C4318 for finding that) 2004-07-27 15:03:53 +00:00
Martin v. Löwis 512efb464b Properly check for Win64 compilers. 2004-07-27 14:16:14 +00:00
Andrew M. Kuchling ce4bae6170 Add an item 2004-07-27 12:13:25 +00:00
Martin v. Löwis 544f1195b1 Patch #995766: Keyword argument support in cPickle. 2004-07-27 05:22:33 +00:00
Martin v. Löwis 7b9190b8fc Patch #998149: imaplib deleteacl and myrights. 2004-07-27 05:07:19 +00:00
Andrew M. Kuchling 5785a1391e Add some items 2004-07-26 19:28:46 +00:00
Andrew M. Kuchling e03664ff22 Two typo fixes 2004-07-26 19:25:54 +00:00
Andrew M. Kuchling e3e1ecacd5 [Bug #997166] Fix example 2004-07-26 18:52:48 +00:00
Fred Drake fdccf1ad6e fix information about what flag database files are opened with by default 2004-07-26 16:33:29 +00:00
Martin v. Löwis c8ae31dcbd Patch #962487: Don't crash for empty locale names. 2004-07-26 12:45:18 +00:00
Martin v. Löwis cc0f93233a Patch #605370: Add description[s] for RFC 2980 compliance. 2004-07-26 12:40:50 +00:00
Martin v. Löwis 32d0c1b458 Patch #995782: Add FreeBSD 5 expectations. Will backport to 2.3. 2004-07-26 12:09:13 +00:00
Martin v. Löwis 37ead8f1c3 Patch #997668: Correct explanation of salts.
Will backport to 2.3.
2004-07-26 12:05:16 +00:00
Tim Peters abba5c067d Explain that most floats are actually integers. This is a common confusion
for people using floor(), ceil() and modf().
2004-07-26 05:12:01 +00:00
Tim Peters 9a729a1cc5 Typo in new docs. 2004-07-26 04:58:50 +00:00
Tim Peters d6ef19309d SF bugs 996748: os.environ documentation should indicate unreliability
Clarifed that os.environ is captured once; emphasized that it's better
to assign to os.environ than to call putenv() directly (the putenv()
docs said so, but the environ docs didn't).
2004-07-26 00:42:41 +00:00
Martin v. Löwis d945f4e17d Generate rc[_d].h after linking 2004-07-25 09:49:26 +00:00
Tim Peters 66bb6e661c SF bug 996392: math and cmath docs don't specify radians
Major rewrite of the math module docs.  Slapped in "radians" where
appropriate; grouped the functions into reasonable categories; supplied
many more words to address common confusions about some of the subtler
issues.
2004-07-24 23:00:24 +00:00
Skip Montanaro 5253da163c added test for bug #996359. 2004-07-24 19:56:03 +00:00
Skip Montanaro 3414c1ceee add missing newlines to read/readline.
fixes bug #996359.
2004-07-24 19:54:44 +00:00