*ordering* between objects; there is only a default equality test
(defined by an object being equal to itself only). Read the comment
in object.c. The current implementation never uses a three-way
comparison to compute a rich comparison, but it does use a rich
comparison to compute a three-way comparison. I'm not quite done
ripping out all the calls to PyObject_Compare/Cmp, or replacing
tp_compare implementations with tp_richcompare implementations;
but much of that has happened (to make most unit tests pass).
The following tests still fail, because I need help deciding
or understanding:
test_codeop -- depends on comparing code objects
test_datetime -- need Tim Peters' opinion
test_marshal -- depends on comparing code objects
test_mutants -- need help understanding it
The problem with test_codeop and test_marshal is this: these tests
compare two different code objects and expect them to be equal.
Is that still a feature we'd like to support? I've temporarily
removed the comparison and hash code from code objects, so they
use the default (equality by pointer only) comparison.
For the other two tests, run them to see for yourself.
(There may be more failing test with "-u all".)
A general problem with getting lots of these tests to pass is
the reality that for object types that have a natural total ordering,
implementing __cmp__ is much more convenient than implementing
__eq__, __ne__, __lt__, and so on. Should we go back to allowing
__cmp__ to provide a total ordering? Should we provide some other
way to implement rich comparison with a single method override?
Alex proposed a __key__() method; I've considered a __richcmp__()
method. Or perhaps __cmp__() just shouldn't be killed off...
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html
Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:
test_codecencodings_cn
test_codecencodings_hk
test_codecencodings_jp
test_codecencodings_kr
test_codecencodings_tw
test_codecs
test_multibytecodec
This merge fixes an actual test failure (test_weakref) in this branch,
though, so I believe merging is the right thing to do anyway.
instead of raising a TypeError. Allows other types to successfully
implement __radd__() style methods.
* Remove future division import from test suite.
* Remove test suite's shadowing of __builtin__.dir().
"all or none" to "all or some".
This provides much greater test coverage without eating much time.
It also makes it more likely that routine regression testing will
unearth bugs.
version 2.39 of dectest.zip adds some new test files and because
some existing test files were getting skipped).
* Remove two docstrings which cluttered unittest's output.
* Simplify a for-loop with a list comprehension.
by the locals() call in the context constructor.
* Remove unnecessary properties for int, exp, and sign which duplicated
information returned by as_tuple().
* Rename "trap_enablers" to just "traps".
* Simplify names of "settraps" and "setflags" to just "traps" and "flags".
* Show "capitals" in the context representation
* Simplify the Context constructor to match its repr form so that only
the set flags and traps need to be listed.
* Representation can now be run through eval().
Improve the error message when the Decimal constructor is given a float.
The test suite no longer needs a duplicate reset_flags method.
public.
* Removed the non-signal conditions from __all__.
* Removed the XXX comment which was resolved.
* Use ^ instead of operator.xor
* Remove the threading lock which is no longer necessary.
* Map conditions to related signals.
* Make contexts unhashable.
* Eliminate used "default" attribute in exception definitions.
* Eliminate the _filterfunc in favor of a straight list.
Docs:
* Eliminate documented references to conditions that are not signals.
* Eliminate parenthetical notes such as "1/0 --> Inf" which are no
longer true with the new defaults.
* Added test for pickling contexts
* Renamed ExceptionList to Signals (to match wording in the spec)
* Simplified Context constructor by allowing flags=None to automatically
generate a zeroed-out flags dictionary.
* inlined _convertString() which was used only once
* _rounding_decision is private, so excluded its contants from __all__.
* added an XXX comment with concerns about subclassing signals results in
a deviation from the spec (maybe important, maybe not).
* Taught the test_suite to determine its own directory (modeled after code
in regrtest.py). Enables it to be run when the current directory is not
the test directory.
* Added a clear_flags() method to the Context API to make it easier to do
a common operation with flags.
* Fixed the trap_enablers defaults in BasicDefaultContext to match the spec.