1. 16 Aug, 2001 37 commits
  2. 15 Aug, 2001 3 commits
    • Guido van Rossum's avatar
      Add tests for overridable operators that have default interpretations · a4ff6ab0
      Guido van Rossum authored
      (__hash__ etc.), in static and dynamic classes, overridden and
      default.
      a4ff6ab0
    • Guido van Rossum's avatar
      - Another big step in the right direction. All the overridable · b8f63664
      Guido van Rossum authored
        operators for which a default implementation exist now work, both in
        dynamic classes and in static classes, overridden or not.  This
        affects __repr__, __str__, __hash__, __contains__, __nonzero__,
        __cmp__, and the rich comparisons (__lt__ etc.).  For dynamic
        classes, this meant copying a lot of code from classobject!  (XXX
        There are still some holes, because the comparison code in object.c
        uses PyInstance_Check(), meaning new-style classes don't get the
        same dispensation.  This needs more thinking.)
      
      - Add object.__hash__, object.__repr__, object.__str__.  The __str__
        dispatcher now calls the __repr__ dispatcher, as it should.
      
      - For static classes, the tp_compare, tp_richcompare and tp_hash slots
        are now inherited together, or not at all.  (XXX I fear there are
        still some situations where you can inherit __hash__ when you
        shouldn't, but mostly it's OK now, and I think there's no way we can
        get that 100% right.)
      b8f63664
    • Just van Rossum's avatar