| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Modified Files:
rpc.py
|
|
|
|
|
|
|
|
| |
underlying dictionaries, there were no reasonable use cases (lexicographic
sorting of a list of sets is somewhat esoteric). Frees the operators
for other uses (such as strict subset and superset comparisons).
Updated documentation and test suite accordingly.
|
|
|
|
|
|
| |
possible. This always called PyUnicode_Check() and PyString_Check(),
at least one of which would call PyType_IsSubtype(). Also, this would
call PyString_Size() on known string objects.
|
|
|
|
|
| |
a dict instead. (Alas, using a Set would be slower instead of
faster.)
|
|
|
|
|
| |
Because all built-in tests return bools now, this is the most common
path!
|
|
|
|
|
|
|
|
|
|
|
|
| |
the inplace operators. The strategy is to have the operator overloading
code do the work and then to define equivalent method calls which rely on
the operators. The changes facilitate proper application of TypeError
and NonImplementedErrors.
Added corresponding tests to the test suite to make sure both the operator
and method call versions get exercised.
Add missing tests for difference_update().
|
|
|
|
|
| |
always returns a bool, so avoid calling PyObject_IsTrue() in that
case.
|
|
|
|
|
|
| |
immediately after the comparison, there in no use in caching the hashcode.
The test, 'if self._hashcode is None', never fails. Removing the caching
saves a few lines and a little time.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2. Replaced calls to Set([]) with Set() -- Timbot's suggestion
3. Fixed subtle bug in sets of sets:
The following code did not work (will add to test suite):
d = Set('d')
s = Set([d]) # Stores inner set as an ImmutableSet
s.remove(d) # For comparison, wraps d in _TemporarilyImmutableSet
The comparison proceeds by computing the hash of the
_TemporarilyImmutableSet and finding it in the dictionary.
It then verifies equality by calling ImmutableSet.__eq__()
and crashes from the binary sanity check.
The problem is that the code assumed equality would be checked
with _TemporarilyImmutableSet.__eq__().
The solution is to let _TemporarilyImmutableSet derive from BaseSet
so it will pass the sanity check and then to provide it with the
._data element from the wrapped set so that ImmutableSet.__eq__()
will find ._data where it expects.
Since ._data is now provided and because BaseSet is the base class,
_TemporarilyImmutableSet no longer needs .__eq__() or .__ne__().
Note that inheriting all of BaseSet's methods is harmless because
none of those methods (except ones starting with an underscore)
can mutate the .data element. Also _TemporarilyImmutableSet is only
used internally as is not otherwise visible.
|
| |
|
|
|
|
| |
arbitrary. I already changed the docs for this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
wrong thing for a unicode subclass when there were zero string
replacements. The example given in the SF bug report was only one way
to trigger this; replacing a string of length >= 2 that's not found is
another. The code would actually write outside allocated memory if
replacement string was longer than the search string.
(I wonder how many more of these are lurking? The unicode code base
is full of wonders.)
Bugfix candidate; this same bug is present in 2.2.1.
|
|
|
|
|
| |
the string/unicode method .replace() with a zero-lengt first argument.
Inyeol contributed tests for this too.
|
| |
|
| |
|
| |
|
|
|
|
| |
latter is what the code actually does.
|
| |
|
|
|
|
| |
Remove the third column in the tables since it isn't used.
|
|
|
|
|
| |
Move another entry so the boilerplate doesn't get mixed up with
document-specific content.
|
| |
|
|
|
|
| |
the element if necessary. Fixed by calling self.remove(element).
|
|
|
|
|
|
| |
required number of args is 0 or 1 -- were reversed. Also change "1"
into "exactly one", the same words as used elsewhere for this
condition.
|
|
|
|
| |
to the list of places where pydoc looks for HTML documents.
|
|
|
|
|
|
| |
rather than a number of approximating regular expressions.
Alas, it is 3-4 times slower. Let that be a challenge for the
tokenize module.
|
|
|
|
| |
classic Python is gone.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
any non-whitespace characters adjacent, not just \w.
|
| |
|
|
|
|
| |
we need to test TextWrapper._split().
|
| |
|
| |
|
|
|
|
|
| |
into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and
Docutils to handle Unix-style command-line options properly.
|
| |
|
|
|
|
| |
unittest.makeSuite() rather than loader.loadTestsFromTestCase().
|
|
|
|
| |
trailing whitespace.
|
|
|
|
|
| |
Expand the example to show some actual test functions, and a setUp()
and tearDown() method.
|
|
|
|
|
|
| |
of dummy_test_TemporaryFile class; when NamedTemporaryFile and
TemporaryFile are the same, simply don't add a test suite for
TemporaryFile.
|
|
|
|
| |
test_main() that creates a suite and runs it. Don't mess with sys.path!!!
|
|
|
|
|
| |
em-dashes -- like this -- properly. (Also--like this. Although this
usage may be incompatible with fixing bug #596434; we shall see.)
|
| |
|
| |
|
|
|
|
| |
suite merging all test cases.
|
| |
|
| |
|