summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Improve exception handling across rpc interfaceKurt B. Kaiser2002-08-241-1/+4
| | | | | Modified Files: rpc.py
* Removed < <= > >= from the API. Implemented as comparisons of theRaymond Hettinger2002-08-243-23/+5
| | | | | | | | 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.
* string_contains(): speed up by avoiding function calls whereGuido van Rossum2002-08-241-9/+12
| | | | | | 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.
* Speed up the most egregious "if token in (long tuple)" cases by usingGuido van Rossum2002-08-241-10/+19
| | | | | a dict instead. (Alas, using a Set would be slower instead of faster.)
* Speedup for PyObject_IsTrue(): check for True and False first.Guido van Rossum2002-08-241-0/+4
| | | | | Because all built-in tests return bools now, this is the most common path!
* At Tim Peter's suggestion, propagated GvR's binary operator changes toRaymond Hettinger2002-08-242-8/+48
| | | | | | | | | | | | 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().
* Speedup for PyObject_RichCompareBool(): PyObject_RichCompare() almostGuido van Rossum2002-08-241-1/+4
| | | | | always returns a bool, so avoid calling PyObject_IsTrue() in that case.
* Since instances of _TemporarilyImmutableSet are always thrown awayRaymond Hettinger2002-08-241-5/+1
| | | | | | 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.
* Expanded tests for sets of sets.Raymond Hettinger2002-08-241-0/+4
|
* 1. Removed module self test in favor of unittests -- Timbot's suggestion.Raymond Hettinger2002-08-241-109/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix typo reported to python-docs.Fred Drake2002-08-231-1/+1
|
* pop() docstring: this isn't a randomly-chosen element, it's merelyTim Peters2002-08-231-1/+1
| | | | arbitrary. I already changed the docs for this.
* Comment repair.Tim Peters2002-08-231-4/+4
|
* Fix SF bug 599128, submitted by Inyeol Lee: .replace() would do theGuido van Rossum2002-08-232-3/+11
| | | | | | | | | | | | | 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.
* Code by Inyeol Lee, submitted to SF bug 595350, to implementGuido van Rossum2002-08-235-48/+61
| | | | | the string/unicode method .replace() with a zero-lengt first argument. Inyeol contributed tests for this too.
* Whitespace normalization.Tim Peters2002-08-239-15/+15
|
* Fix markup and punctuationRaymond Hettinger2002-08-231-4/+4
|
* Got rid of the toy _Set class, in favor of sets.Set.Tim Peters2002-08-231-33/+6
|
* s/_as_Temporarily_Immutable/_as_temporarily_immutable/g, because theTim Peters2002-08-231-2/+2
| | | | latter is what the code actually does.
* pop(): An arbitrary element is removed, not a random element.Tim Peters2002-08-231-1/+2
|
* Adjust the markup in a few places so this will actually format.Fred Drake2002-08-231-92/+89
| | | | Remove the third column in the tables since it isn't used.
* Add an entry for the sets module documentation.Fred Drake2002-08-231-1/+2
| | | | | Move another entry so the boilerplate doesn't get mixed up with document-specific content.
* Load docs for sets.pyRaymond Hettinger2002-08-232-0/+220
|
* RH pointed out that discard(element) doesn't do the transformation onGuido van Rossum2002-08-231-1/+1
| | | | the element if necessary. Fixed by calling self.remove(element).
* The error messages in err_args() -- which is only called when theGuido van Rossum2002-08-231-2/+2
| | | | | | 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.
* Added the standard MacOSX location for documentation inside a frameworkJack Jansen2002-08-231-1/+2
| | | | to the list of places where pydoc looks for HTML documents.
* Rewritten using the tokenize module, which gives us a real tokenizerGuido van Rossum2002-08-231-188/+144
| | | | | | rather than a number of approximating regular expressions. Alas, it is 3-4 times slower. Let that be a challenge for the tokenize module.
* Don't build ConfigurePythonCarbon and ConfigurePythonClassic any longer,Jack Jansen2002-08-221-2/+2
| | | | classic Python is gone.
* For MacPython-OS9 verbose is the default.Jack Jansen2002-08-221-0/+3
|
* Interface to Apple Help Manager.Jack Jansen2002-08-223-0/+255
|
* Moved CoreFoundation type support to bgen/macsupport.Jack Jansen2002-08-227-70/+75
|
* Added PyDoc_STR's.Jack Jansen2002-08-221-112/+112
|
* Tweak wordsep_re again: this time to recognize an em-dash withGreg Ward2002-08-221-1/+1
| | | | any non-whitespace characters adjacent, not just \w.
* Test an em-dash with adjacent punctuation.Greg Ward2002-08-221-0/+6
|
* Factored out BaseTestCase.check_split() method -- use it whereverGreg Ward2002-08-221-8/+8
| | | | we need to test TextWrapper._split().
* Test _split() method in test_unix_options().Greg Ward2002-08-221-0/+9
|
* Add test_unix_options() to WrapTestCase to test for SF bug #596434.Greg Ward2002-08-221-0/+28
|
* Fix SF bug #596434: tweak wordsep_re so "--foo-bar" now splitsGreg Ward2002-08-221-1/+1
| | | | | into /--foo-/bar/ rather than /--/foo-/bar/. Needed for Optik and Docutils to handle Unix-style command-line options properly.
* Standardize behavior: no docstrings in test functions.Guido van Rossum2002-08-222-18/+17
|
* Standardize behavior: no docstrings in test functions. Also useGuido van Rossum2002-08-221-6/+4
| | | | unittest.makeSuite() rather than loader.loadTestsFromTestCase().
* Standardize behavior: no docstrings in test functions. Also stripGuido van Rossum2002-08-221-16/+16
| | | | trailing whitespace.
* Document that docstrings are verboten for test functions.Guido van Rossum2002-08-221-6/+34
| | | | | Expand the example to show some actual test functions, and a setUp() and tearDown() method.
* Standardize behavior: no docstrings in test functions. Also get ridGuido van Rossum2002-08-221-42/+37
| | | | | | of dummy_test_TemporaryFile class; when NamedTemporaryFile and TemporaryFile are the same, simply don't add a test suite for TemporaryFile.
* Standardize behavior: no docstrings in test functions; add a properGuido van Rossum2002-08-221-46/+44
| | | | test_main() that creates a suite and runs it. Don't mess with sys.path!!!
* Add test_em_dash() to WrapTestCase to make sure that TextWrapper handlesGreg Ward2002-08-221-2/+53
| | | | | em-dashes -- like this -- properly. (Also--like this. Although this usage may be incompatible with fixing bug #596434; we shall see.)
* Standardize behavior: no docstrings in test functions.Guido van Rossum2002-08-222-10/+13
|
* Standardize behavior: create a single suite merging all test cases.Guido van Rossum2002-08-221-3/+5
|
* Standardize behavior: no docstrings in test functions; create a singleGuido van Rossum2002-08-221-13/+19
| | | | suite merging all test cases.
* Made it more readable.Guido van Rossum2002-08-221-46/+30
|
* Fix peculiar (and ungrammatical) wording in an example program.Greg Ward2002-08-221-2/+2
|