Barry Warsaw [Tue, 14 Aug 2001 18:28:28 +0000 (18:28 +0000)]
Test the new semantics for setting and deleting a function's __dict__
attribute. Deleting it, or setting it to a non-dictionary result in a
TypeError. Note that getting it the first time magically initializes
it to an empty dict so that func.__dict__ will always appear to be a
dictionary (never None).
Barry Warsaw [Tue, 14 Aug 2001 18:23:58 +0000 (18:23 +0000)]
func_getattro(), func_setattro(): Implement the new semantics for
setting and deleting a function's __dict__ attribute. Deleting
it, or setting it to a non-dictionary result in a TypeError. Note
that getting it the first time magically initializes it to an
empty dict so that func.__dict__ will always appear to be a
dictionary (never None).
Barry Warsaw [Tue, 14 Aug 2001 18:22:24 +0000 (18:22 +0000)]
Describe the new semantics for setting and deleting a function's
__dict__ attribute. Deleting it, or setting it to a non-dictionary
result in a TypeError. Note that getting it the first time magically
initializes it to an empty dict so that func.__dict__ will always
appear to be a dictionary (never None).
Barry Warsaw [Mon, 13 Aug 2001 23:04:56 +0000 (23:04 +0000)]
Py_Initialize(): Apply patch by Jürgen Hermann to call
_PyImport_FixupExtension() on the exceptions module. Now
reload(exceptions) acts just like reload(sys) instead of raising
an ImportError.
Fred Drake [Mon, 13 Aug 2001 19:31:59 +0000 (19:31 +0000)]
David Goodger <dgoodger@atsautomation.com>:
Documentation for difflib/ndiff refactoring: more of the ndiff functionality
has been moved to the underlying library (difflib).
Guido van Rossum [Mon, 13 Aug 2001 14:12:35 +0000 (14:12 +0000)]
Fix two bugs discovered by PyChecker. (I cannot test these, but I'm
confident that the old code was utterly broken -- the worse that can
happen is that the new code is still broken.)
Tim Peters [Mon, 13 Aug 2001 05:33:53 +0000 (05:33 +0000)]
+ A msg on c.l.py reminded me that docstrings can be implicitly catenated.
Cater to that.
+ Major speed boost via not reading more of files than necessary. This
was no slouch before; now it screams.
+ Improve msg when giving up on a goofy future statement.
Jeremy Hylton [Sun, 12 Aug 2001 21:52:24 +0000 (21:52 +0000)]
Remove much dead code from ceval.c
The descr changes moved the dispatch for calling objects from
call_object() in ceval.c to PyObject_Call() in abstract.c.
call_object() and the many functions it used in ceval.c were no longer
used, but were not removed.
Rename meth_call() as PyCFunction_Call() so that it can be called by
the CALL_FUNCTION opcode in ceval.c.
Also, fix error message that referred to PyEval_EvalCodeEx() by its
old name eval_code2(). (I'll probably refer to it by its old name,
too.)
Guido van Rossum [Sun, 12 Aug 2001 05:24:18 +0000 (05:24 +0000)]
- Expand test for dynamic objects.
- Remove various 'global' directives and move some global definitions
inside the test functions that use them -- we have nested scopes so
the old hacks using globals are no longer needed.
Guido van Rossum [Sun, 12 Aug 2001 05:17:56 +0000 (05:17 +0000)]
Make dynamic types work as intended. Or at least more so.
XXX There are still some loose ends: repr(), str(), hash() and
comparisons don't inherit a default implementation from object. This
must be resolved similarly to the way it's resolved for classic
instances.
Guido van Rossum [Sun, 12 Aug 2001 03:43:35 +0000 (03:43 +0000)]
Temporary stop-gap fix for dynamic classes, so they pass the test.
XXX This is not sufficient: if a dynamic class has no __repr__ method
(for instance), but later one is added, that doesn't add a tp_repr
slot, so repr() doesn't call the __repr__ method. To make this work,
I'll have to add default implementations of several slots to 'object'.
XXX Also, dynamic types currently only inherit slots from their
dominant base.
Guido van Rossum [Sun, 12 Aug 2001 02:22:19 +0000 (02:22 +0000)]
Add the list of expected skips for Linux 2.x. Restructured the code a
little bit using a dictionary to avoid more code duplication as
more platforms are supported.
Jeremy Hylton [Sun, 12 Aug 2001 01:54:38 +0000 (01:54 +0000)]
SF Patch [ 429024 ] deal with some unary ops at compile time
Revised version of Fred's patch, including support for ~ operator.
If the unary +, -, or ~ operator is applied to a constant, don't
generate a UNARY_xxx opcode. Just store the approriate value as a
constant. If the value is negative, extend the string containing the
constant and insert a negative in the 0th position.
For ~, compute the inverse of int and longs and use them directly, but
be prepared to generate code for all other possibilities (invalid
numbers, floats, complex).
Tim Peters [Sun, 12 Aug 2001 00:41:33 +0000 (00:41 +0000)]
_Condition.wait(): never sleep longer than the timeout time remaining,
and even if we have a long time left to wait, try the lock at least 20
times/second.
Jack Jansen [Sat, 11 Aug 2001 23:22:43 +0000 (23:22 +0000)]
The test assumed that the local pathname convention for "foo" would sort before "foo/bar", which is not true on the mac (where they are "foo" and ":foo:bar", respectively; ":foo" would be fine too, but "foo" is the preferred spelling). Fixed by sorting the output.
Jack Jansen [Sat, 11 Aug 2001 23:18:55 +0000 (23:18 +0000)]
test_glob found a nasty bug in GUSI opendir(): it will not fail when called on files, but in stead open the parent directory! We now explicitly test for the argument being a directory and simulate ENOTDIR otherwise.
Jack Jansen [Sat, 11 Aug 2001 21:54:11 +0000 (21:54 +0000)]
Patch by Jonathan Wight (slightly reformatted) to forestall loading the
same module twice, which apparently crashes Python. I could not test the
error condition, but in normal life it seems to have no adverse effects.
Also removed an unsued variable, and corrected 2 glaring errors (missing
'case' in front of a label).
Guido van Rossum [Sat, 11 Aug 2001 04:37:07 +0000 (04:37 +0000)]
Finally fix SF bug #441172, using a variant of patch ##443626:
canceling an edit operation would not revert the value of the field.
The fix takes care to destroy the Entry object, as suggested in the
patch.
Tim Peters [Sat, 11 Aug 2001 04:01:31 +0000 (04:01 +0000)]
Now that the dialogs have some breathing room, split the combo of Tcl/Tk,
IDLE and pydoc into a separate component. That's almost as big as the
rest of Python (excl. docs and test suite) combined.
Pop up a confimation box if they choose to install at least one of
{Tcl/Tk/IDLE/pydoc, Tools, Test suite} but do not choose to install
Python -- doesn't make much sense, so ask whether that's really what they
want.
Fred Drake [Sat, 11 Aug 2001 03:28:41 +0000 (03:28 +0000)]
For the escape() function, added a reference to the quoteattrs() function
in xml.sax.saxutils, since that is the right function to use for quoting
attribute values.
This closes SF bug #444707.
Cleaned up a variety of other minor markup errors.
Jeremy Hylton [Fri, 10 Aug 2001 21:41:33 +0000 (21:41 +0000)]
Refactor future feature handling
Replace uses of PyCF_xxx with CO_xxx.
Replace individual feature slots in PyFutureFeatures with single
bitmask ff_features.
When flags must be transfered among the three parts of the interpreter
that care about them -- the pythonrun layer, the compiler, and the
future feature parser -- can simply or (|) the definitions.
Jeremy Hylton [Fri, 10 Aug 2001 21:38:04 +0000 (21:38 +0000)]
Refactor future feature handling
Replace individual slots in PyFutureFeatures with a single bitmask
with one field per feature. The flags for this bitmask are the same
as the flags used in the co_flags slot of a code object.
XXX This means we waste several bits, because they are used
for co_flags but have no meaning for future statements. Don't
think this is an issue.
Remove the NESTED_SCOPES_DEFAULT define and others. Not sure what
they were for anyway.
Remove all the PyCF_xxx flags, but define PyCF_MASK in terms of the
CO_xxx flags that are relevant for this release.
Change definition of PyCompilerFlags so that cf_flags matches
co_flags.
Guido van Rossum [Fri, 10 Aug 2001 21:24:08 +0000 (21:24 +0000)]
- Big changes to fix SF bug #442833 (a nasty multiple inheritance
problem). inherit_slots() is split in two parts: inherit_special()
which inherits the flags and a few very special members from the
dominant base; inherit_slots() which inherits only regular slots,
and is now called for each base in the MRO in turn. These are now
both void functions since they don't have error returns.
- Added object.__setitem__() back -- for the same reason as
object.__new__(): a subclass of object should be able to call
object.__new__().
- add_wrappers() was moved around to be closer to where it is used (it
was defined together with add_methods() etc., but has nothing to do
with these).
Guido van Rossum [Fri, 10 Aug 2001 20:28:28 +0000 (20:28 +0000)]
Add PyDict_Merge(a, b, override):
PyDict_Merge(a, b, 1) is the same as PyDict_Update(a, b).
PyDict_Merge(a, b, 0) does something similar but leaves existing items
unchanged.
[Bug #414032] Make the 'sdist' command work when the distribution contains
libraries. This is done by adding a .get_source_files() method,
contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker
Fred Drake [Fri, 10 Aug 2001 19:47:41 +0000 (19:47 +0000)]
Added this LaTeX style file to the package since not all LaTeX installations
have it, especially on non-Unix platforms. (MikTeX in particular does not
have it.)