1. 22 Aug, 2002 31 commits
  2. 21 Aug, 2002 9 commits
    • Fred Drake's avatar
      Added a main() function and support to run this module as a script. · 94790947
      Fred Drake authored
      Closes SF feature request #588768.
      94790947
    • Fred Drake's avatar
      Refactor: Remove some code that was obsoleted when this module was · 724d9a69
      Fred Drake authored
                 changed to use universal newlines.
      
                 Remove all imports from the compile() function; these are
                 now done at the top of the module ("Python normal form"),
                 and define a helper based on the platform instead of
                 testing the platform in the compile() function.
      724d9a69
    • Fred Drake's avatar
      Clarify that even though some of the relevant specifications define the · d3cadd60
      Fred Drake authored
      order in which form variables should be encoded in a request, a CGI script
      should not rely on that since a client may not conform to those specs, or
      they may not be relevant to the request.
      Closes SF bug #596866.
      d3cadd60
    • Raymond Hettinger's avatar
      Now that __init__ transforms set elements, we know that all of the · 58685111
      Raymond Hettinger authored
      elements are hashable, so we can use dict.update() or dict.copy()
      for a C speed Set.copy().
      58685111
    • Raymond Hettinger's avatar
    • Raymond Hettinger's avatar
      Replace all cases of "while 1" with "while True". · 76a30dcf
      Raymond Hettinger authored
      Though slightly slower, has better clarity and teaching value.
      76a30dcf
    • Raymond Hettinger's avatar
    • Guido van Rossum's avatar
      Ouch. The test suite *really* needs work!!!!! There were several · 8a34d6b6
      Guido van Rossum authored
      superficial errors and one deep one that aren't currently caught.  I'm
      headed for bed after this checkin.
      
      - Fixed several typos introduced by Raymond Hettinger (through
        cut-n-paste from my template): it's _as_temporarily_immutable, not
        _as_temporary_immutable, and moreover when the element is added, we
        should use _as_immutable.
      
      - Made the seq argument to ImmutableSet.__init__ optional, so we can
        write ImmutableSet() to create an immutable empty set.
      
      - Rename the seq argument to Set and ImmutableSet to iterable.
      
      - Add a Set.__hash__ method that raises a TypeError.  We inherit a
        default __hash__ implementation from object, and we don't want that.
        We can then catch this in update(), so that
        e.g. s.update([Set([1])]) will transform the Set([1]) to
        ImmutableSet([1]).
      
      - Added the dance to catch TypeError and try _as_immutable in the
        constructors too (by calling _update()).  This is needed so that
        Set([Set([1])]) is correctly interpreted as
        Set([ImmutableSet([1])]).  (I was puzzled by a side effect of this
        and the inherited __hash__ when comparing two sets of sets while
        testing different powerset implementations: the Set element passed
        to a Set constructor wasn't transformed to an ImmutableSet, and then
        the dictionary didn't believe the Set found in one dict it was the
        same as ImmutableSet in the other, because the hashes were
        different.)
      
      - Refactored Set.update() and both __init__() methods; moved the body
        of update() into BaseSet as _update(), and call this from __init__()
        and update().
      
      - Changed the NotImplementedError in BaseSet.__init__ to TypeError,
        both for consistency with basestring() and because we have to use
        TypeError when denying Set.__hash__.  Together those provide
        sufficient evidence that an unimplemented method needs to raise
        TypeError.
      8a34d6b6
    • Guido van Rossum's avatar
      Add Raymond H to the list of authors; add some XXX comments about · 0da9d90b
      Guido van Rossum authored
      possible API improvements.
      0da9d90b