]> granicus.if.org Git - python/log
python
21 years agoAddressing SF bug #643005, implement socket.inet_aton() using
Guido van Rossum [Wed, 12 Feb 2003 23:08:22 +0000 (23:08 +0000)]
Addressing SF bug #643005, implement socket.inet_aton() using
inet_aton() rather than inet_addr() -- the latter is obsolete because
it has a problem: "255.255.255.255" is a valid address but
indistinguishable from an error.

(I'm not sure if inet_aton() exists everywhere -- in case it doesn't,
I've left the old code in with an #ifdef.)

21 years agoCleanup from patch #683257:
Neal Norwitz [Wed, 12 Feb 2003 23:02:21 +0000 (23:02 +0000)]
Cleanup from patch #683257:
 Add missing INCREFs and re-indent returns to be consistent.
 Add \n\ for lines in docstring
 Add a pathetic test
 Add docs

21 years agoProvide access to the import lock, fixing SF bug #580952. This is
Guido van Rossum [Wed, 12 Feb 2003 21:46:11 +0000 (21:46 +0000)]
Provide access to the import lock, fixing SF bug #580952.  This is
mostly from SF patch #683257, but I had to change unlock_import() to
return an error value to avoid fatal error.

Should this be backported?  The patch requested this, but it's a new
feature.

21 years agoIssue a warning when int('0...', 0) returns an int with the sign
Guido van Rossum [Wed, 12 Feb 2003 20:48:22 +0000 (20:48 +0000)]
Issue a warning when int('0...', 0) returns an int with the sign
folded; this will change in Python 2.4.  On a 32-bit machine, this
happens for 0x80000000 through 0xffffffff, and for octal constants in
the same value range.  No warning is issued if an explicit base is
given, *or* if the string contains a sign (since in those cases no
sign folding ever happens).

21 years agoExpect test_ossaudiodev to skip on Linux, too. (It's broken.
Guido van Rossum [Wed, 12 Feb 2003 20:40:08 +0000 (20:40 +0000)]
Expect test_ossaudiodev to skip on Linux, too.  (It's broken.
Volunteers wanted to fix it!)

21 years agoSystematic testing of hex/oct constants.
Guido van Rossum [Wed, 12 Feb 2003 17:09:17 +0000 (17:09 +0000)]
Systematic testing of hex/oct constants.

21 years agoSF #660455 : patch by NNorwitz.
Guido van Rossum [Wed, 12 Feb 2003 17:05:26 +0000 (17:05 +0000)]
SF #660455 : patch by NNorwitz.

"Unsigned" (i.e., positive-looking, but really negative) hex/oct
constants with a leading minus sign are once again properly negated.
The micro-optimization for negated numeric constants did the wrong
thing for such hex/oct constants.  The patch avoids the optimization
for all hex/oct constants.

This needs to be backported to Python 2.2!

21 years agoSF #660455 : patch by NNorwitz.
Guido van Rossum [Wed, 12 Feb 2003 16:57:47 +0000 (16:57 +0000)]
SF #660455 : patch by NNorwitz.

"Unsigned" (i.e., positive-looking, but really negative) hex/oct
constants with a leading minus sign are once again properly negated.
The micro-optimization for negated numeric constants did the wrong
thing for such hex/oct constants.  The patch avoids the optimization
for all hex/oct constants.

This needs to be backported to Python 2.2!

21 years ago- Use distutils to find site-python (suggested by Thomas Heller, thanks!)
Jack Jansen [Wed, 12 Feb 2003 16:37:00 +0000 (16:37 +0000)]
- Use distutils to find site-python (suggested by Thomas Heller, thanks!)
- Fixed a bug for packages without MD5 checksum.

21 years agoIcons for the package manager.
Jack Jansen [Wed, 12 Feb 2003 16:20:23 +0000 (16:20 +0000)]
Icons for the package manager.

21 years agoThank you sir, can I have another.
Just van Rossum [Wed, 12 Feb 2003 16:19:39 +0000 (16:19 +0000)]
Thank you sir, can I have another.

21 years agoPhotoshop source file for package manager icon.
Jack Jansen [Wed, 12 Feb 2003 16:16:52 +0000 (16:16 +0000)]
Photoshop source file for package manager icon.

21 years agoUse bundlebuilder directly to build applets.
Jack Jansen [Wed, 12 Feb 2003 15:42:49 +0000 (15:42 +0000)]
Use bundlebuilder directly to build applets.

21 years agoAllow this to run both standalone and as a window in the IDE.
Jack Jansen [Wed, 12 Feb 2003 15:39:56 +0000 (15:39 +0000)]
Allow this to run both standalone and as a window in the IDE.

21 years agoMore int() around float arguments.
Jack Jansen [Wed, 12 Feb 2003 15:39:16 +0000 (15:39 +0000)]
More int() around float arguments.

21 years agoCreate applets slightly differently: by saving the sourcecode to a
Jack Jansen [Wed, 12 Feb 2003 15:38:37 +0000 (15:38 +0000)]
Create applets slightly differently: by saving the sourcecode to a
temporary location. This is needed to makethings work with the new
buildtools based on bundlebuilder.

21 years agoWhen in MacPython-OSX use bundlebuilder to create .app bundles.
Jack Jansen [Wed, 12 Feb 2003 15:37:26 +0000 (15:37 +0000)]
When in MacPython-OSX use bundlebuilder to create .app bundles.

21 years ago- Better way to find site-packages
Jack Jansen [Wed, 12 Feb 2003 15:36:25 +0000 (15:36 +0000)]
- Better way to find site-packages
- Catch stderr as well as stdout
- Fixed a bug with non-installable packages
- Parse .pth files after installing, so you don't have to restart Python (or
  the IDE) after installing.

21 years agoRenamed InstallManager to PackageManager, finished a first stab at the
Jack Jansen [Wed, 12 Feb 2003 12:47:56 +0000 (12:47 +0000)]
Renamed InstallManager to PackageManager, finished a first stab at the
implementation and integrated it into the IDE.

21 years agoIn a MultiList select all cells in the row, not only the first one.
Jack Jansen [Wed, 12 Feb 2003 12:47:00 +0000 (12:47 +0000)]
In a MultiList select all cells in the row, not only the first one.

21 years agoUpdated the Mac documentation to the current state of affairs.
Jack Jansen [Wed, 12 Feb 2003 09:58:33 +0000 (09:58 +0000)]
Updated the Mac documentation to the current state of affairs.

21 years agoMinor cleanup of new batch-list/dict code.
Tim Peters [Wed, 12 Feb 2003 05:28:58 +0000 (05:28 +0000)]
Minor cleanup of new batch-list/dict code.

21 years agoImplement another useful feature for proxies: in super(X, x), x may
Guido van Rossum [Wed, 12 Feb 2003 03:58:38 +0000 (03:58 +0000)]
Implement another useful feature for proxies: in super(X, x), x may
now be a proxy for an X instance, as long as issubclass(x.__class__, X).

21 years agoAdd missing cast in previous fix.
Guido van Rossum [Wed, 12 Feb 2003 03:36:05 +0000 (03:36 +0000)]
Add missing cast in previous fix.

21 years agoSF #532767: isinstance(x, X) should work when x is a proxy for an X
Guido van Rossum [Wed, 12 Feb 2003 03:32:58 +0000 (03:32 +0000)]
SF #532767: isinstance(x, X) should work when x is a proxy for an X
instance, as long as x.__class__ is X or a subclass thereof.
Did a little cleanup of PyObject_IsInstance() too.

21 years agoAn install manager window for the IDE and standalone use. Unfinished.
Jack Jansen [Tue, 11 Feb 2003 23:15:33 +0000 (23:15 +0000)]
An install manager window for the IDE and standalone use. Unfinished.

21 years agoAdd more missing PyErr_NoMemory() after failled memory allocs
Neal Norwitz [Tue, 11 Feb 2003 23:05:40 +0000 (23:05 +0000)]
Add more missing PyErr_NoMemory() after failled memory allocs

21 years agoImplemented batching for dicts in cPickle. This is after two failed
Tim Peters [Tue, 11 Feb 2003 22:43:24 +0000 (22:43 +0000)]
Implemented batching for dicts in cPickle.  This is after two failed
attempts to merge the C list-batch and dict-batch code -- they worked, but
it was a godawful mess to read.

21 years agoChanged database format to make fields adhere to PEP 241 where
Jack Jansen [Tue, 11 Feb 2003 22:40:59 +0000 (22:40 +0000)]
Changed database format to make fields adhere to PEP 241 where
applicable, and use a similar naming scheme for other fields. This
has drastically changed the structure, as the PEP241 names aren't
identifiers.

21 years agoAdd Str, a subclass of str.
Guido van Rossum [Tue, 11 Feb 2003 21:19:11 +0000 (21:19 +0000)]
Add Str, a subclass of str.

21 years agoImplemented list batching in cPickle.
Tim Peters [Tue, 11 Feb 2003 21:06:20 +0000 (21:06 +0000)]
Implemented list batching in cPickle.

21 years agoFix from SF #681367: inherit tp_as_buffer. This only applies to C
Guido van Rossum [Tue, 11 Feb 2003 20:39:59 +0000 (20:39 +0000)]
Fix from SF #681367: inherit tp_as_buffer.  This only applies to C
types -- Python types already inherited this.

21 years agoAdd compilation instructions for xxmodule.c.
Guido van Rossum [Tue, 11 Feb 2003 20:05:50 +0000 (20:05 +0000)]
Add compilation instructions for xxmodule.c.

21 years agoUnparenting BZ2File, as discussed in SF patch #661796.
Gustavo Niemeyer [Tue, 11 Feb 2003 18:46:20 +0000 (18:46 +0000)]
Unparenting BZ2File, as discussed in SF patch #661796.

* Modules/bz2module.c
  (BZ2FileObject): Now the structure includes a pointer to a file object,
   instead of "inheriting" one. Also, some members were copied from the
   PyFileObject structure to avoid dealing with the internals of that
   structure from outside fileobject.c.

  (Util_GetLine,Util_DropReadAhead,Util_ReadAhead,Util_ReadAheadGetLineSkip,
   BZ2File_write,BZ2File_writelines,BZ2File_init,BZ2File_dealloc,
   BZ2Comp_dealloc,BZ2Decomp_dealloc):
    These functions were adapted to the change above.

  (BZ2File_seek,BZ2File_close): Use PyObject_CallMethod instead of
   getting the function attribute locally.

  (BZ2File_notsup): Removed, since it's not necessary anymore to overload
   truncate(), and readinto() with dummy functions.

  (BZ2File_methods): Added xreadlines() as an alias to BZ2File_getiter,
   and removed truncate() and readinto().

  (BZ2File_get_newlines,BZ2File_get_closed,BZ2File_get_mode,BZ2File_get_name,
   BZ2File_getset):
    Implemented getters for "newlines", "mode", and "name".

  (BZ2File_members): Implemented "softspace" member.

  (BZ2File_init): Reworked to create a file instance instead of initializing
   itself as a file subclass. Also, pass "name" object untouched to the
   file constructor, and use PyObject_CallFunction instead of building the
   argument tuple locally.

  (BZ2File_Type): Set tp_new to PyType_GenericNew, tp_members to
   BZ2File_members, and tp_getset to BZ2File_getset.

  (initbz2): Do not set BZ2File_Type.tp_base nor BZ2File_Type.tp_new.

* Doc/lib/libbz2.tex
  Do not mention that BZ2File inherits from the file type.

21 years agoPut proper tests in classmethod_get(). Remove the type argument to
Guido van Rossum [Tue, 11 Feb 2003 18:44:42 +0000 (18:44 +0000)]
Put proper tests in classmethod_get().  Remove the type argument to
descr_check(); it wasn't useful.  Change the type argument of the
various _get() methods to PyObject * because the call signature of
tp_descr_get doesn't guarantee its type.

21 years agoRefactor instancemethod_descr_get() to (a) be more clear, (b) be safe
Guido van Rossum [Tue, 11 Feb 2003 18:43:00 +0000 (18:43 +0000)]
Refactor instancemethod_descr_get() to (a) be more clear, (b) be safe
in the light of weird args, and (c) not to expect None (which is now
changed to NULL by slot_tp_descr_get()).

21 years agoSF bug 684667: Modules/selectmodule.c returns NULL without exception set.
Tim Peters [Tue, 11 Feb 2003 17:18:58 +0000 (17:18 +0000)]
SF bug 684667: Modules/selectmodule.c returns NULL without exception set.
select_select() didn't set an exception in the SELECT_USES_HEAP case when
malloc() returned NULL.

21 years agoInline create_specialmethod() -- since METH_CLASS is done differently
Guido van Rossum [Tue, 11 Feb 2003 17:12:46 +0000 (17:12 +0000)]
Inline create_specialmethod() -- since METH_CLASS is done differently
now, it was only called once, and its existence merely obfuscates the
control flow.

21 years agoAdded tests to ensure that list and dict "chunking" are actually
Tim Peters [Tue, 11 Feb 2003 16:40:16 +0000 (16:40 +0000)]
Added tests to ensure that list and dict "chunking" are actually
getting done.  Since this isn't yet implemented in cPickle, the
new tests are in TempAbstractPickleTests (which cPickle doesn't
run).

21 years ago- More int() calls around floating point numbers passed where integers are
Jack Jansen [Tue, 11 Feb 2003 16:26:26 +0000 (16:26 +0000)]
- More int() calls around floating point numbers passed where integers are
  expected.
- Fixed resizing of multi-column lists, somewhat.

21 years agoAdd basic arg sanity checking to wrap_descr_get(). This is called
Guido van Rossum [Tue, 11 Feb 2003 16:25:43 +0000 (16:25 +0000)]
Add basic arg sanity checking to wrap_descr_get().  This is called
when Python code calls a descriptor's __get__ method.  It should
translate None to NULL in both argument positions, and insist that at
least one of the argument positions is not NULL after this
transformation.

21 years agoRemove duplicate word (rules)
Neal Norwitz [Tue, 11 Feb 2003 14:30:39 +0000 (14:30 +0000)]
Remove duplicate word (rules)

21 years agoFix so it compiles at least.
Michael W. Hudson [Tue, 11 Feb 2003 14:24:13 +0000 (14:24 +0000)]
Fix so it compiles at least.

"make lib" takes a while, doesn't it?

21 years agoAdd item pertaining to
Michael W. Hudson [Tue, 11 Feb 2003 14:19:56 +0000 (14:19 +0000)]
Add item pertaining to

[ 680429 ] __module__ broken for extension classes

21 years agoGet rid of the "bozo" __getstate__ that was inserted when __slots__
Guido van Rossum [Mon, 10 Feb 2003 21:31:27 +0000 (21:31 +0000)]
Get rid of the "bozo" __getstate__ that was inserted when __slots__
was used.  This simplifies some logic in copy_reg.py (used by
pickling).  It also broke a test, but this was rewritten to test the
new feature. :-)

21 years agoPatch #676839: Cygwin _iconv_codec module patch
Jason Tishler [Mon, 10 Feb 2003 20:48:35 +0000 (20:48 +0000)]
Patch #676839: Cygwin _iconv_codec module patch

The attached patch enables the _iconv_codec
module to build cleanly under Cygwin.

21 years agoPatch #676837: Cygwin array module patch
Jason Tishler [Mon, 10 Feb 2003 20:45:47 +0000 (20:45 +0000)]
Patch #676837: Cygwin array module patch

The attached patch enables the array module
to build cleanly under Cygwin again.

21 years ago[ 683376 ] Adding NotImplementedType to types.py
Just van Rossum [Mon, 10 Feb 2003 19:38:33 +0000 (19:38 +0000)]
[ 683376 ] Adding NotImplementedType to types.py

21 years agoMake comments agree with code (I think).
Michael W. Hudson [Mon, 10 Feb 2003 19:36:46 +0000 (19:36 +0000)]
Make comments agree with code (I think).

21 years agoSundry very picky changes.
Michael W. Hudson [Mon, 10 Feb 2003 19:24:50 +0000 (19:24 +0000)]
Sundry very picky changes.

21 years agoRemove erroneous period.
Michael W. Hudson [Mon, 10 Feb 2003 19:21:16 +0000 (19:21 +0000)]
Remove erroneous period.

21 years agoUpdate advice about __module__ and __name__ and tp_name wrt. new types.
Michael W. Hudson [Mon, 10 Feb 2003 19:18:21 +0000 (19:18 +0000)]
Update advice about __module__ and __name__ and tp_name wrt. new types.

Add \refs to GC section that were XXXed out.

21 years agoA typo, and desist from inaccurately describing some things as lists.
Michael W. Hudson [Mon, 10 Feb 2003 19:12:42 +0000 (19:12 +0000)]
A typo, and desist from inaccurately describing some things as lists.

21 years agoAdd a few tests to test_count() to increase coverage in
Walter Dörwald [Mon, 10 Feb 2003 17:51:03 +0000 (17:51 +0000)]
Add a few tests to test_count() to increase coverage in
Object/unicodeobject.c::unicode_count().

21 years agoFix copy&paste error: call title instead of count
Walter Dörwald [Mon, 10 Feb 2003 17:44:16 +0000 (17:44 +0000)]
Fix copy&paste error: call title instead of count

21 years agoChange filtertuple() to use tp_as_sequence->sq_item
Walter Dörwald [Mon, 10 Feb 2003 17:36:40 +0000 (17:36 +0000)]
Change filtertuple() to use tp_as_sequence->sq_item
instead of PyTuple_GetItem, so an overwritten __getitem__
in a tuple subclass works. SF bug #665835.

21 years agoPunctuation fixes in docstrings.
Jack Jansen [Mon, 10 Feb 2003 16:08:17 +0000 (16:08 +0000)]
Punctuation fixes in docstrings.

21 years agoFold long lines.
Guido van Rossum [Mon, 10 Feb 2003 16:05:43 +0000 (16:05 +0000)]
Fold long lines.

21 years agoAdded docstrings.
Jack Jansen [Mon, 10 Feb 2003 15:55:51 +0000 (15:55 +0000)]
Added docstrings.

21 years agoAdd Neil's suggestions for avoiding this warning
Andrew M. Kuchling [Mon, 10 Feb 2003 15:08:16 +0000 (15:08 +0000)]
Add Neil's suggestions for avoiding this warning

21 years agoSquashed compiler wng about signed/unsigned clash in comparison.
Tim Peters [Mon, 10 Feb 2003 14:48:29 +0000 (14:48 +0000)]
Squashed compiler wng about signed/unsigned clash in comparison.

21 years ago- Better exception when the database isn't found.
Jack Jansen [Mon, 10 Feb 2003 14:19:14 +0000 (14:19 +0000)]
- Better exception when the database isn't found.
- Allow for "manual:" pseudo-scheme in downloadURL to signal that
  the download should be done manually.

21 years agoPick up Makefile variable BASECFLAGS too. This is needed since OPT was
Jack Jansen [Mon, 10 Feb 2003 14:02:33 +0000 (14:02 +0000)]
Pick up Makefile variable BASECFLAGS too. This is needed since OPT was
split into OPT and BASECFLAGS (Makefile.pre.in rev. 1.108), because
now there are essential CFLAGS in BASECFLAGS.

21 years agoUse MD5 checksums to check archive integrity and forestall downloads.
Jack Jansen [Mon, 10 Feb 2003 13:38:44 +0000 (13:38 +0000)]
Use MD5 checksums to check archive integrity and forestall downloads.

21 years agoChange filterstring() and filterunicode(): If the
Walter Dörwald [Mon, 10 Feb 2003 13:19:13 +0000 (13:19 +0000)]
Change filterstring() and filterunicode(): If the
object is not a real str or unicode but an instance
of a subclass, construct the output via looping
over __getitem__. This guarantees that the result
is the same for function==None and function==lambda x:x

This doesn't happen for tuples, because filtertuple()
uses PyTuple_GetItem().

(This was discussed on SF bug #665835).

21 years agoAdded preInstall and postInstall commands to packages. PIL needs this
Jack Jansen [Mon, 10 Feb 2003 13:08:04 +0000 (13:08 +0000)]
Added preInstall and postInstall commands to packages. PIL needs this
(preInstall, at least).

21 years agomention unicode file name support on OSX
Just van Rossum [Mon, 10 Feb 2003 10:06:18 +0000 (10:06 +0000)]
mention unicode file name support on OSX

21 years agomention unicode support in compile, eval and exec
Just van Rossum [Mon, 10 Feb 2003 09:57:08 +0000 (09:57 +0000)]
mention unicode support in compile, eval and exec

21 years agoMy previous checkin caused compile() to no longer accept buffers, as noted
Just van Rossum [Mon, 10 Feb 2003 09:22:01 +0000 (09:22 +0000)]
My previous checkin caused compile() to no longer accept buffers, as noted
my MAL. Fixed. (Btw. eval() still doesn't take buffers, but that was so
even before my patch.)

21 years agopatch #683515: "Add unicode support to compile(), eval() and exec"
Just van Rossum [Mon, 10 Feb 2003 08:21:10 +0000 (08:21 +0000)]
patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.

21 years agoFix memory leak of newstr when putenv() fails
Neal Norwitz [Mon, 10 Feb 2003 03:10:43 +0000 (03:10 +0000)]
Fix memory leak of newstr when putenv() fails

21 years agoFix SF bug #683467, 'int' ability to generate longs not inherited
Neal Norwitz [Mon, 10 Feb 2003 02:12:43 +0000 (02:12 +0000)]
Fix SF bug #683467, 'int' ability to generate longs not inherited

When subclassing from an int but not overriding __new__,
long values were not converted properly.  Try to convert
longs into an int.

21 years agoAdd tests and news entry about parser errors from bug #678518.
Neal Norwitz [Mon, 10 Feb 2003 01:54:06 +0000 (01:54 +0000)]
Add tests and news entry about parser errors from bug #678518.

21 years agoAlphabetize some names
Neal Norwitz [Mon, 10 Feb 2003 01:09:49 +0000 (01:09 +0000)]
Alphabetize some names
Add Grant Olson for patch provided to fix bug #678518

21 years agoRemove duplicate code introduced by fixing bug #678518
Neal Norwitz [Mon, 10 Feb 2003 01:08:50 +0000 (01:08 +0000)]
Remove duplicate code introduced by fixing bug #678518

21 years agoFix two refcounting bugs
Walter Dörwald [Sun, 9 Feb 2003 23:42:56 +0000 (23:42 +0000)]
Fix two refcounting bugs

21 years agoStrawman for a Package Install Manager for Python. It isn't CPAN yet, but at
Jack Jansen [Sun, 9 Feb 2003 23:10:20 +0000 (23:10 +0000)]
Strawman for a Package Install Manager for Python. It isn't CPAN yet, but at
less than 500 lines it already manages to test whether Numeric is installed,
and can install it if it isn't, including any prerequisites.

21 years agopatch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
Just van Rossum [Sun, 9 Feb 2003 20:38:48 +0000 (20:38 +0000)]
patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
mark. Added unit test.

21 years agoRename 'proto' keyword arg to 'protocol' . Greg Ward's suggestion.
Guido van Rossum [Sun, 9 Feb 2003 17:19:41 +0000 (17:19 +0000)]
Rename 'proto' keyword arg to 'protocol' .  Greg Ward's suggestion.

21 years agoRemove unused variable.
Guido van Rossum [Sun, 9 Feb 2003 17:19:18 +0000 (17:19 +0000)]
Remove unused variable.

21 years agoC Code:
Raymond Hettinger [Sun, 9 Feb 2003 06:40:58 +0000 (06:40 +0000)]
C Code:
* Removed the ifilter flag wart by splitting it into two simpler functions.
* Fixed comment tabbing in C code.
* Factored module start-up code into a loop.

Documentation:
* Re-wrote introduction.
* Addede examples for quantifiers.
* Simplified python equivalent for islice().
* Documented split of ifilter().

Sets.py:
* Replace old ifilter() usage with new.

21 years agoSF patch #683187, fix universal newline problems on error
Neal Norwitz [Sun, 9 Feb 2003 01:10:02 +0000 (01:10 +0000)]
SF patch #683187, fix universal newline problems on error

21 years agoApply logistix's patch from
Michael W. Hudson [Sat, 8 Feb 2003 18:05:10 +0000 (18:05 +0000)]
Apply logistix's patch from

[ 678518 ] Another parsermodule validation error

21 years agoThe Python implementation of datetime was changed in ways that no longer
Tim Peters [Sat, 8 Feb 2003 03:46:31 +0000 (03:46 +0000)]
The Python implementation of datetime was changed in ways that no longer
tickle the 2.2.2 __cmp__ bug test_datetime used to tickle, so the
workarounds for that bug no longer make sense in the test suite (which I'm
still trying to keep as closely in synch as possible with Zope3's
version).

21 years agotimedelta comparison and datetime addition: as the Python implementation
Tim Peters [Sat, 8 Feb 2003 03:28:59 +0000 (03:28 +0000)]
timedelta comparison and datetime addition:  as the Python implementation
of datetime does, accept instances of subclasses too.

21 years agoFix compatibility for earlier versions of Python (than 2.3), which
Barry Warsaw [Sat, 8 Feb 2003 03:18:58 +0000 (03:18 +0000)]
Fix compatibility for earlier versions of Python (than 2.3), which
doesn't have UserDict.DictMixin.

21 years agoComparison for timedelta, time, date and datetime objects: __eq__ and
Tim Peters [Fri, 7 Feb 2003 22:50:28 +0000 (22:50 +0000)]
Comparison for timedelta, time, date and datetime objects:  __eq__ and
__ne__ no longer complain if they don't know how to compare to the other
thing.  If no meaningful way to compare is known, saying "not equal" is
sensible.  This allows things like

    if adatetime in some_sequence:
and
    somedict[adatetime] = whatever

to work as expected even if some_sequence contains non-datetime objects,
or somedict non-datetime keys, because they only call __eq__.

It still complains (raises TypeError) for mixed-type comparisons in
contexts that require a total ordering, such as list.sort(), use as a
key in a BTree-based data structure, and cmp().

21 years agoMerge the test part of the below checkin to the sandbox and Zope3, so
Guido van Rossum [Fri, 7 Feb 2003 21:49:01 +0000 (21:49 +0000)]
Merge the test part of the below checkin to the sandbox and Zope3, so
the tests will remain in sync:

"""
Tres discovered a weird bug when a datetime is pickled, caused by the
shadowing of __year, __month, __day and the use of proxies.

Here's a quick fix and a quick unit test.  I don't quite understand
why this wasn't caught by the pickling unit tests.
"""

21 years agoReserve a range for Zope, not specifically for Zope 3.
Guido van Rossum [Fri, 7 Feb 2003 20:56:38 +0000 (20:56 +0000)]
Reserve a range for Zope, not specifically for Zope 3.

21 years agoFix SF bug #642168, help() fails for some builtin topics
Neal Norwitz [Fri, 7 Feb 2003 20:49:40 +0000 (20:49 +0000)]
Fix SF bug #642168, help() fails for some builtin topics

Fix pydoc when doing help for:  and, or, not, UNICODE.

Will backport.

21 years agoUpdate URL
Andrew M. Kuchling [Fri, 7 Feb 2003 20:22:33 +0000 (20:22 +0000)]
Update URL

21 years agoSF patch #682514, mmapmodule.c write fix for LP64 executables
Neal Norwitz [Fri, 7 Feb 2003 19:44:56 +0000 (19:44 +0000)]
SF patch #682514, mmapmodule.c write fix for LP64 executables

Make length an int so we get the right value from
PyArg_ParseTuple(args, "s#", &str, &length)

Will backport.

21 years agoSomehow, copy() of a classic class object was handled
Guido van Rossum [Fri, 7 Feb 2003 17:53:23 +0000 (17:53 +0000)]
Somehow, copy() of a classic class object was handled
atomically, but deepcopy() didn't support this at all.
I don't see any reason for this, so I'm adding ClassType
to the set of types that are deep-copied atomically.

21 years agoAdd support for copy_reg.dispatch_table.
Guido van Rossum [Fri, 7 Feb 2003 17:30:18 +0000 (17:30 +0000)]
Add support for copy_reg.dispatch_table.

Rewrote copy() and deepcopy() without avoidable try/except statements;
getattr(x, name, None) or dict.get() are much faster than try/except.

21 years agoMade AskFile* dialogs movable-modal by default, by providing a dummy
Jack Jansen [Fri, 7 Feb 2003 15:45:40 +0000 (15:45 +0000)]
Made AskFile* dialogs movable-modal by default, by providing a dummy
eventProc (which simply drops all events on the floor). Also added a
method SetDefaultEventProc through which frameworks can set a global
event handler (which can still be overridden on a per-call basis
with the eventProc argument).

21 years agoAdd __getnewargs__ method to classes that need it.
Guido van Rossum [Fri, 7 Feb 2003 14:59:13 +0000 (14:59 +0000)]
Add __getnewargs__ method to classes that need it.

(Yes, this is an incompatibility.  I'll document it in PEP 307.)

21 years ago- make some links into the reference documentation relative for
Fred Drake [Fri, 7 Feb 2003 14:52:18 +0000 (14:52 +0000)]
- make some links into the reference documentation relative for
  off-line readers
- fix some minor typos and markup errors

21 years ago* Eliminated tuple re-use in imap(). Doing it correctly made the code
Raymond Hettinger [Fri, 7 Feb 2003 07:26:25 +0000 (07:26 +0000)]
* Eliminated tuple re-use in imap().  Doing it correctly made the code
  too hard to read.
* Simplified previous changes to izip() to make it easier to read.

21 years agoSF bug #681003: itertools issues
Raymond Hettinger [Fri, 7 Feb 2003 05:32:58 +0000 (05:32 +0000)]
SF bug #681003: itertools issues

* Fixed typo in exception message for times()
* Filled in missing times_traverse()
* Document reasons that imap() did not adopt a None fill-in feature
* Document that count(sys.maxint) will wrap-around on overflow
* Add overflow test to islice()
* Check that starmap()'s argument returns a tuple
* Verify that imap()'s tuple re-use is safe
* Make a similar tuple re-use (with safety check) for izip()

21 years agoFix SF bug #675259, os.environ leaks under FreeBSD and Mac OS X
Neal Norwitz [Fri, 7 Feb 2003 02:27:36 +0000 (02:27 +0000)]
Fix SF bug #675259, os.environ leaks under FreeBSD and Mac OS X

Even with the extra work to cleanup the env, *BSD still leaks.  Add a note.

Will backport.