Fred Drake [Thu, 13 Apr 2000 14:52:27 +0000 (14:52 +0000)]
Thomas Heller <thomas.heller@ion-tof.com>:
ihooks.ModuleLoader does not implement reload(mod) correctly:
If mod has already been loaded by ModuleLoader, it has
been returned from a cache. Added an additional parameter
to import_it() to force reloading.
Changed PyUnicode_Splitlines() maxsplit argument to keepends.
The maxsplit functionality was replaced by the keepends
functionality which allows keeping the line end markers together
with the string.
The maxsplit functionality in .splitlines() was replaced by the keepends
functionality which allows keeping the line end markers together
with the string.
Added support for '%r' % obj: this inserts repr(obj) rather
than str(obj).
The maxsplit functionality in .splitlines() was replaced by the keepends
functionality which allows keeping the line end markers together
with the string.
Added special case to unicode(): when being passed a
Unicode object as first argument, return the object as-is.
Raises an exception when given a Unicode object *and* an
encoding name.
Bunch of new names, mostly from patches and bugs mailing lists
(everyone who said something remotely useful in the last 100 messages
I archived has been added :-).
Simple optimization by Christian Tismer, who gives credit to Lenny
Kneler for reporting this issue: long_mult() is faster when the
smaller argument is on the left. Swap the arguments accordingly.
Implement suggestion from Lawrence Kesteloot in PR#280, to change the
default list of files from () to None, and explicitly test for None
before defaulting to sys.argv[1:]. This means that if you pass in an
explicit empty list, it will read stdin instead of defaulting to
sys.argv[1:]. This fixes a buglet in the test script (when called
with options but without files, it chokes when it tries to interpret
the options as files).
Lawrence adds: "I suspect that this is a safe change, because I can't
imagine someone actively passing in an empty list when they want
sys.argv used."
Fred Drake [Mon, 10 Apr 2000 16:27:47 +0000 (16:27 +0000)]
Use a better approach to locating IDLE's default configuration,
allowing it to be run from anywhere, including through a symlink to
the actual idle.py script.
Patch by Vladimir Marangozov to include the function name when
comparing code objects. This give sless surprising results in
-Optimized code. It also sorts code objects by name, now.
[I changed the patch to hash() slightly to touch fewer lines.]
Fred Drake [Mon, 10 Apr 2000 15:36:39 +0000 (15:36 +0000)]
Use a constant to specify the number of child threads to create.
Instead of assuming that the number process ids of the threads is the
same as the process id of the controlling process, use a copy of the
dictionary and check for changes in the process ids of the threads
from the thread's process ids in the parent process. This makes the
test make more sense on systems which assign a new pid to each thread
(i.e., Linux).
This doesn't fix the other problems evident with this test on Linux.
* '...%s...' % u"abc" now coerces to Unicode just like
string methods. Care is taken not to reevaluate already formatted
arguments -- only the first Unicode object appearing in the
argument mapping is looked up twice. Added test cases for
this to test_unicode.py.
* The experimental Keep-Alive optimization was turned back
on after some tweaks to the implementation. It should now
work without causing core dumps... this has yet to tested
though (switching it off is easy: see the unicodeobject.c
file for details).
* Fixed a memory leak in the Unicode freelist cleanup code.
* Added tests to correctly process the return code from
_PyUnicode_Resize().
* Fixed a bug in the 'ignore' error handling routines
of some builtin codecs. Added test cases for these to
test_unicode.py.
* string_contains now calls PyUnicode_Contains() only when the other
operand is a Unicode string (not whenever it's not a string).
* New format style '%r' inserts repr(arg) instead of str(arg).
* '...%s...' % u"abc" now coerces to Unicode just like
string methods. Care is taken not to reevaluate already formatted
arguments -- only the first Unicode object appearing in the
argument mapping is looked up twice. Added test cases for
this to test_unicode.py.
In line with a similar checkin to object.c a while ago, this patch
gives a more descriptive error message for an attribute error on a
class instance. The message now looks like:
AttributeError: 'Descriptor' instance has no attribute 'GetReturnType'
Added a check for the 'force' attribute in '__getattr__()' -- better than
crashing when self.force not defined.
Revise 'copy_file()' and 'copy_tree()' docstrings accordingly.
Remove 'hasattr()' check for 'self.force' from 'make_file()'.
Added '--force' option -- very clear what it means for building (ignore
timestamps), so every build_* command has 'self.force', which follows the
'build' command if not set by the user.
Removed global '--force' option -- just too vague a concept to be applicable
to all commands in the same way. Several Command methods now either expect
'self.force' to be defined, or check if it is defined and assume it's
false if not.