1. 31 May, 2002 1 kayıt (commit)
  2. 03 Nis, 2002 1 kayıt (commit)
    • Guido van Rossum's avatar
      Add the 'bool' type and its values 'False' and 'True', as described in · 77f6a65e
      Guido van Rossum yazdı
      PEP 285.  Everything described in the PEP is here, and there is even
      some documentation.  I had to fix 12 unit tests; all but one of these
      were printing Boolean outcomes that changed from 0/1 to False/True.
      (The exception is test_unicode.py, which did a type(x) == type(y)
      style comparison.  I could've fixed that with a single line using
      issubtype(x, type(y)), but instead chose to be explicit about those
      places where a bool is expected.
      
      Still to do: perhaps more documentation; change standard library
      modules to return False/True from predicates.
      77f6a65e
  3. 19 Şub, 2002 1 kayıt (commit)
  4. 29 Eki, 2001 1 kayıt (commit)
  5. 09 Eki, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Halfway checkin. This is still messy, but it's beginning to address · 7b9144b2
      Guido van Rossum yazdı
      the problem that slots weren't inherited properly.  override_slots()
      no longer exists; in its place comes fixup_slot_dispatchers() which
      does more and different work and is table-based.  (Eventually I want
      this table also to replace all the little tab_foo tables.)
      
      Also add a wrapper for __delslice__; this required a change in
      test_descrtut.py.
      7b9144b2
  6. 25 Eyl, 2001 2 kayıt (commit)
    • Guido van Rossum's avatar
      - Provisional support for pickling new-style objects. (*) · 3926a63d
      Guido van Rossum yazdı
      - Made cls.__module__ writable.
      
      - Ensure that obj.__dict__ is returned as {}, not None, even upon first
        reference; it simply springs into life when you ask for it.
      
      (*) The pickling support is provisional for the following reasons:
      
      - It doesn't support classes with __slots__.
      
      - It relies on additional support in copy_reg.py: the C method
        __reduce__, defined in the object class, really calls calling
        copy_reg._reduce(obj).  Eventually the Python code in copy_reg.py
        needs to be migrated to C, but I'd like to experiment with the
        Python implementation first.  The _reduce() code also relies on an
        additional helper function, _reconstructor(), defined in
        copy_reg.py; this should also be reimplemented in C.
      3926a63d
    • Guido van Rossum's avatar
      Change repr() of a new-style class to say <class 'ClassName'> rather · a4cb7887
      Guido van Rossum yazdı
      than <type 'ClassName'>.  Exception: if it's a built-in type or an
      extension type, continue to call it <type 'ClassName>.  Call me a
      wimp, but I don't want to break more user code than necessary.
      a4cb7887
  7. 21 Eyl, 2001 1 kayıt (commit)
  8. 09 Eyl, 2001 2 kayıt (commit)
    • Tim Peters's avatar
      Teach regrtest how to pass on doctest failure msgs. This is done via a · a0a62225
      Tim Peters yazdı
      horridly inefficient hack in regrtest's Compare class, but it's about as
      clean as can be:  regrtest has to set up the Compare instance before
      importing a test module, and by the time the module *is* imported it's too
      late to change that decision.  The good news is that the more tests we
      convert to unittest and doctest, the less the inefficiency here matters.
      Even now there are few tests with large expected-output files (the new
      cost here is a Python-level call per .write() when there's an expected-
      output file).
      a0a62225
    • Tim Peters's avatar
      Force "test." into the start of the module name, inherited by class and · 90ba8d9c
      Tim Peters yazdı
      type reprs, to accomodate the way Jack runs tests on the Mac.
      90ba8d9c
  9. 06 Eyl, 2001 1 kayıt (commit)
  10. 03 Eyl, 2001 2 kayıt (commit)
    • Tim Peters's avatar
      Make dir() wordier (see the new docstring). The new behavior is a mixed · 5d2b77cf
      Tim Peters yazdı
      bag.  It's clearly wrong for classic classes, at heart because a classic
      class doesn't have a __class__ attribute, and I'm unclear on whether
      that's feature or bug.  I'll repair this once I find out (in the
      meantime, dir() applied to classic classes won't find the base classes,
      while dir() applied to a classic-class instance *will* find the base
      classes but not *their* base classes).
      
      Please give the new dir() a try and see whether you love it or hate it.
      The new dir([]) behavior is something I could come to love.  Here's
      something to hate:
      
      >>> class C:
      ...     pass
      ...
      >>> c = C()
      >>> dir(c)
      ['__doc__', '__module__']
      >>>
      
      The idea that an instance has a __doc__ attribute is jarring (of course
      it's really c.__class__.__doc__ == C.__doc__; likewise for __module__).
      
      OTOH, the code already has too many special cases, and dir(x) doesn't
      have a compelling or clear purpose when x isn't a module.
      5d2b77cf
    • Tim Peters's avatar