Commit graph

28970 commits

Author SHA1 Message Date
Hye-Shik Chang
7db07e6972 Fix gcc 3.3 warnings related to Py_UNICODE_WIDE. 2003-12-29 01:36:01 +00:00
Andrew MacIntyre
f1ca7f561c complete backout of listobject.c v2.171 2003-12-28 07:43:56 +00:00
Jeremy Hylton
30973414c5 Revert previous two checkins to repair test failure.
The special-case code that was removed could return a value indicating
success but leave an exception set.  test_fileinput failed in a debug
build as a result.
2003-12-26 19:05:04 +00:00
Jeremy Hylton
87c1afa057 Fix name problem in previous checkin: Dict not List 2003-12-26 17:17:49 +00:00
Andrew MacIntyre
e99990f9e1 At 2.2, the Py<type>_Check() family of API functions (macros) changed
semantics to include subtypes.  Most concrete object APIs then had
a Py<type>_CheckExact() macro added to test for an object's type
not including subtypes.

The PyDict_CheckExact() macro wasn't created at that time, so I've added
it for API completeness/symmetry - even though nobody has complained
about its absence in the time since 2.2 was released.

Not a backport candidate.
2003-12-26 00:20:53 +00:00
Andrew MacIntyre
6f3a24d0b3 reverting 2.29: the patch was Ok, but the commit msg wrong 2003-12-26 00:19:28 +00:00
Andrew MacIntyre
694e3a4a9d use the correct macro to access list size 2003-12-26 00:09:04 +00:00
Andrew MacIntyre
f72af655c5 At 2.2, the Py<type>_Check() family of API functions (macros) changed
semantics to include subtypes.  Most concrete object APIs then had
a Py<type>_CheckExact() macro added to test for an object's type
not including subtypes.

The PyDict_CheckExact() macro wasn't created at that time, so I've added
it for API completeness/symmetry - even though nobody has complained
about its absence in the time since 2.2 was released.

Not a backport candidate.
2003-12-26 00:07:51 +00:00
Andrew MacIntyre
43e5711309 The semantics of PyList_Check() and PyDict_Check() changed at 2.2, along
with most other concrete object checks, but the docs weren't brought into
line.

PyList_CheckExact() was added at 2.2 but never documented.

backport candidate.
2003-12-26 00:02:23 +00:00
Andrew MacIntyre
13cd8898d2 The semantics of PyList_Check() and PyDict_Check() changed at 2.2, along
with most other concrete object checks, but the docs weren't brought into
line.

PyList_CheckExact() was added at 2.2 but never documented.

backport candidate.
2003-12-25 23:57:52 +00:00
Andrew MacIntyre
d57caed52c Performance of list([]) in 2.3 came up in a thread on comp.lang.python,
which can be reviewed via
http://coding.derkeiler.com/Archive/Python/comp.lang.python/2003-12/1011.html

Duncan Booth investigated, and discovered that an "optimisation" was
in fact a pessimisation for small numbers of elements in a source list,
compared to not having the optimisation, although with large numbers
of elements in the source list the optimisation was quite beneficial.

He posted his change to comp.lang.python (but not to SF).

Further research has confirmed his assessment that the optimisation only
becomes a net win when the source list has more than 100 elements.

I also found that the optimisation could apply to tuples as well,
but the gains only arrive with source tuples larger than about 320
elements and are nowhere near as significant as the gains with lists,
(~95% gain @ 10000 elements for lists, ~20% gain @ 10000 elements for
tuples) so I haven't proceeded with this.

The code as it was applied the optimisation to list subclasses as
well, and this also appears to be a net loss for all reasonable sized
sources (~80-100% for up to 100 elements, ~20% for more than 500
elements; I tested up to 10000 elements).

Duncan also suggested special casing empty lists, which I've extended
to all empty sequences.

On the basis that list_fill() is only ever called with a list for the
result argument, testing for the source being the destination has
now happens before testing source types.
2003-12-25 13:28:48 +00:00
Andrew MacIntyre
4d04639380 add definitions required for expat 1.95.7 2003-12-25 13:25:20 +00:00
Andrew M. Kuchling
7553426342 [Bug #850823] Fix broken link 2003-12-23 17:04:35 +00:00
Andrew M. Kuchling
91ca8de6f4 [Bug #850818] Accept Gregory H. Ball's suggested rewrite of a confusing description 2003-12-23 17:01:38 +00:00
Andrew M. Kuchling
7a3786cc55 [Bug #857821] Remove mention of deprecated string.{atol,atof} functions. (Patch from Gerrit Holl) 2003-12-23 16:53:34 +00:00
Andrew M. Kuchling
273069deec Fix silly typo 2003-12-23 16:46:41 +00:00
Andrew M. Kuchling
b386f6a509 As part of fixing bug #829532, add a test case that exercises os.makedirs 2003-12-23 16:36:11 +00:00
Andrew M. Kuchling
6fccc8a9ec [Bug #829532] Invoking os.makedirs() with an argument that contains a
directory name with a single dot fails.  The patch skips creating
    directories named os.curdir. (Patch by Bram Moolenaar)

2.3 bugfix candidate.
2003-12-23 16:33:28 +00:00
Hye-Shik Chang
7fc4cf57b8 Fix unicode.rsplit()'s bug that ignores separater on the end of string when
using specialized splitter for 1 char sep.
2003-12-23 09:10:16 +00:00
Tim Peters
0490fe96d8 Changed the UCHAR_MAX error msg a bit: we don't really assume anything
about "characters", we assume something about C's char type (which is
an integral type).
2003-12-22 18:10:51 +00:00
Skip Montanaro
ac4ea13a3a There are places in Python which assume bytes have 8-bits. Formalize that a
bit by checking the value of UCHAR_MAX in Include/Python.h.  There was a
check in Objects/stringobject.c.  Remove that.  (Note that we don't define
UCHAR_MAX if it's not defined as the old test did.)
2003-12-22 16:31:41 +00:00
Hye-Shik Chang
66518bbb67 (forced commit)
Previous revision was a fix for a problem by not 2.204 but 2.205.
2003-12-22 01:33:08 +00:00
Hye-Shik Chang
40e9509dc7 Fix broken xmlcharrefreplace by rev 2.204.
(Pointy hat goes to perky)
2003-12-22 01:31:13 +00:00
Raymond Hettinger
9014560412 Make sure the UserDict copies do not share the same underlying
dictionary as the original.  This parallels MvL's change to
Lib/os.py 1.56.

Backport candidate.
2003-12-21 22:19:08 +00:00
Thomas Heller
435f648584 Python 2.3.3 Window build number and release date. 2003-12-20 22:29:03 +00:00
Raymond Hettinger
70029c5450 Add the first of (hopefully) many third-party licenses and acknowledgements. 2003-12-20 20:53:31 +00:00
Walter Dörwald
893020b59b Remove self from the arguments for the function add_type().
Backport candidate.
2003-12-19 18:15:10 +00:00
Hye-Shik Chang
4a264fb054 SF #859573: Reduce compiler warnings on gcc 3.2 and above. 2003-12-19 01:59:56 +00:00
Hye-Shik Chang
8d2e08dcdf Enable some unittests on FreeBSD.
test__locale: add typical POSIX-style full locale names.
test_locale: use en_US.US-ASCII on FreeBSD.
2003-12-19 01:16:03 +00:00
Skip Montanaro
302e550403 Sync with python-mode project. Adds two changes:
* in py-checker-run, fall back to read-string if read-shell-command
  (XEmacs-specific) is not available.

* highlight variables would mask builtins as if they were keywords.
2003-12-18 21:53:33 +00:00
Fred Drake
828f847d66 minor markup adjustment 2003-12-18 20:58:34 +00:00
Andrew M. Kuchling
3435820842 Fix typo 2003-12-18 13:28:35 +00:00
Andrew M. Kuchling
35f2b05dca Add various items 2003-12-18 13:28:13 +00:00
Fred Drake
852fe0689a fix loss of a space after indexing markup 2003-12-18 06:26:56 +00:00
Fred Drake
4d88322a2b - use correct markup
- re-wrap resulting long lines
2003-12-18 06:23:33 +00:00
Fred Drake
1639f1cef9 fix weird sh-bang line 2003-12-18 05:29:33 +00:00
Fred Drake
2fe79783a7 avoid bash-isms 2003-12-18 05:28:30 +00:00
Raymond Hettinger
a95e87a488 Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
2003-12-17 21:38:26 +00:00
Raymond Hettinger
b606b3d08a Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
2003-12-17 20:50:46 +00:00
Jeremy Hylton
e708fbd286 Remove methods that are no longer called by urllib2. 2003-12-17 20:47:28 +00:00
Raymond Hettinger
64958a15d7 Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
2003-12-17 20:43:33 +00:00
Jeremy Hylton
df38ea9c29 Add methods to MockHTTPClass for modern httplib interface.
Replace lots of assert_(x == y) with assertEqual(x, y).
2003-12-17 20:42:38 +00:00
Jeremy Hylton
023518a6a8 Rewrite AbstractHTTPHandler to use modern httplib interface.
The chief benefit of this change is that requests will now use
HTTP/1.1 instead of HTTP/1.0.  Bump the module version number as part
of the change.

There are two possible incompatibilities that we'll need to watch out
for when we get to an alpha release.  We may get a different class of
exceptions out of httplib, and the do_open() method changed its
signature.  The latter is only important if anyone actually subclasses
AbstractHTTPHandler.
2003-12-17 18:52:16 +00:00
Hye-Shik Chang
a7b673f47c Fix erroneus argument parsing of socket.htons() on 64bit big endian
machines.
2003-12-17 09:40:23 +00:00
Hye-Shik Chang
c6f066f9a3 Update documentations for str.rsplit() with Alex Martelli's rewrite. 2003-12-17 02:49:03 +00:00
Andrew M. Kuchling
4612bc587b Make example more readable 2003-12-16 20:59:37 +00:00
Raymond Hettinger
81ad32e435 Speedup set.update by using the override mode for PyDict_Merge(). 2003-12-15 21:16:06 +00:00
Hye-Shik Chang
eebb641f23 Add rsplit method for UserString, too.
(Spotted by Raymond Hettinger)
2003-12-15 19:46:09 +00:00
Raymond Hettinger
c0d49d82de Fix typo and improve wording a bit. 2003-12-15 19:24:34 +00:00
Hye-Shik Chang
060ebedc40 Add an entry for addition of {str,unicode}.rsplit. 2003-12-15 18:51:19 +00:00