summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* PEP 293 implemention (from SF patch http://www.python.org/sf/432401)Walter Dörwald2002-09-022-1/+495
|
* _structure(): Use .get_content_type()Barry Warsaw2002-09-011-1/+1
|
* Further SET_LINENO reomval fixes. See comments in patch #587933.Michael W. Hudson2002-08-302-1/+110
| | | | | | | | | | Use a slightly different strategy to determine when not to call the line trace function. This removes the need for the RETURN_NONE opcode, so that's gone again. Update docs and comments to match. Thanks to Neal and Armin! Also add a test suite. This should have come with the original patch...
* Many hopefully benign style clean ups. Still passes the test suite ofBarry Warsaw2002-08-291-172/+200
| | | | course.
* strptime(): The code that was adding 12 to PM hours was incorrectBarry Warsaw2002-08-291-5/+12
| | | | | | | | | because it added it to 12 PM too. 12 PM should be hour 12 not hour 24. Also cleaned up a minor style nit. There are more style problems in this file that I'll clean up next (but I didn't want them to overwhelm the substance of this fix).
* The test I saw failing this morning just happened to be run at 8amBarry Warsaw2002-08-291-0/+12
| | | | | | | | localtime, which in -0400 is 12 noon GMT. The bug boiled down to broken conversion of 12 PM to hour 12 for the '%I %p' format string. Added a test for this specific condition: Strptime12AMPMTests. Fix to _strptime.py coming momentarily.
* Sped _update().Raymond Hettinger2002-08-291-0/+9
| | | | Uses the fast update() method when a dictionary is available.
* Undo Barry's change. This file is not imported, it's fed as input toGuido van Rossum2002-08-292-15/+15
| | | | | | the tokenize module by test_tokenize.py. The FutureWarnings only appeared during installation, and I've figured out a way to suppress those in a different way.
* Restore the hex/oct constant tests that Barry commented out for fearGuido van Rossum2002-08-291-2/+9
| | | | of FutureWarnings. Added a comment explaining the situation.
* complex() was the only numeric constructor that created a new instanceRaymond Hettinger2002-08-291-0/+4
| | | | when given its own type as an argument.
* Fixed three exceptions in the Plain integers test, although I'm notBarry Warsaw2002-08-291-3/+3
| | | | | | | | | | | sure these are the best fixes. - Test maxint-1 against the negative octal constant -020000000000 - Comment out the tests for oct -1 and hex -1, since 037777777777 and 0xffffffff raise FutureWarnings now and in Python 2.4 those constants will produce positive values, not negative values. So the existing test seems to test something that won't be true in 2.4.
* The test_tokenize output has changed slightly, by the addition of someBarry Warsaw2002-08-291-12/+12
| | | | trailing `L's.
* Quite down some FutureWarnings.Barry Warsaw2002-08-282-6/+6
|
* Whitespace normalization.Barry Warsaw2002-08-271-1/+1
|
* TypoBarry Warsaw2002-08-271-1/+1
|
* Fix an inaccuracy in the commentBarry Warsaw2002-08-261-2/+2
|
* Gave intersection_update a speed boost.Tim Peters2002-08-261-3/+1
|
* Gave issubet() and issuperset() major speed boosts. That's it for now!Tim Peters2002-08-251-2/+4
| | | | Someone else may want to tackle the mutating operations similarly.
* Gave __sub__/difference a factor of 2-5 speed boost.Tim Peters2002-08-251-1/+2
|
* Gave __xor__/symmetric_difference a factor of 2-5 speed boost.Tim Peters2002-08-251-4/+6
|
* Sped union by a factor of 3-4.Tim Peters2002-08-251-1/+2
|
* Sped intersection by large factors (3-5x faster than before on sets ofTim Peters2002-08-251-7/+2
| | | | cardinality 500; and the smaller the intersection, the bigger the speedup).
* Added a clue about why xyz_update isn't the same as __xyz__.Tim Peters2002-08-251-1/+4
|
* Implemented <, <=, >, >= for sets, giving subset and proper-subsetTim Peters2002-08-252-7/+33
| | | | | | meanings. I did not add new, e.g., ispropersubset() methods; we're going nuts on those, and, e.g., there was no "friendly name" for == either.
* TestSubset(): Generalized the framework to support testing upcomingTim Peters2002-08-251-10/+23
| | | | <, <=, etc methods too.
* Rewrote all remaining assert stmts.Tim Peters2002-08-251-30/+30
|
* Simplified construction of the test suite.Tim Peters2002-08-251-21/+23
|
* Simplified code building sets of characters.Tim Peters2002-08-251-5/+5
|
* Ack! Virtually every test here relied on an assert stmt. assert stmtsTim Peters2002-08-251-60/+60
| | | | should never be used in tests. Repaired dozens, but more is needed.
* Simplified the setup for is-subset testing.Tim Peters2002-08-251-25/+20
|
* Record a clue about why __or__ is not union, etc.Tim Peters2002-08-251-0/+5
|
* Replace 0 with False to match working in documentation. SF 599681.Raymond Hettinger2002-08-251-2/+2
|
* 1. Revert subprocess environment clearing, will restart subprocessKurt B. Kaiser2002-08-253-39/+17
| | | | | | | | | | instead. 2. Preserve the Idle client's listening socket for reuse with the fresh subprocess. 3. Remove some unused rpc code, comment out additional unused code. Modified Files: ScriptBinding.py rpc.py run.py
* 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-242-20/+3
| | | | | | | | 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.
* 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.)
* 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().
* 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.
* 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-231-0/+2
| | | | | | | | | | | | | 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-233-10/+8
| | | | | the string/unicode method .replace() with a zero-lengt first argument. Inyeol contributed tests for this too.
* Whitespace normalization.Tim Peters2002-08-236-12/+12
|
* Got rid of the toy _Set class, in favor of sets.Set.Tim Peters2002-08-231-33/+6
|
* 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).
* 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.
* 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.