1. 08 Eki, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      Widespread random code cleanup. · 7d016857
      Tim Peters yazdı
      Most of this code was old enough to vote.  Examples of cleanups:
      
      + Backslashes were used for line continuation even inside unclosed
        bracket structures, from back in the days that was still needed.
      
      + There was no use of % formats, and e.g. the old fpformat module was
        still used to format floats "by hand" in conjunction with rjust().
      
      + There was even use of a do-nothing .ignore() method to tack on to the
        end of a chain of method calls, else way back when Python would print
        the non-None result (as it does now in an interactive session -- it
        *used* to do that in batch mode too).
      
      + Perhaps controversial (although I can't imagine why for real <wink>),
        used augmented assignment where helpful.  Stuff like
      
            self.total_calls = self.total_calls + other.total_calls
      
        is just plain harder to follow than
      
            self.total_calls += other.total_calls
      7d016857
  2. 07 Eki, 2001 13 kayıt (commit)
  3. 06 Eki, 2001 5 kayıt (commit)
    • Tim Peters's avatar
      _PyObject_VAR_SIZE: always round up to a multiple-of-pointer-size value. · 6d483d34
      Tim Peters yazdı
      As Guido suggested, this makes the new subclassing code substantially
      simpler.  But the mechanics of doing it w/ C macro semantics are a mess,
      and _PyObject_VAR_SIZE has a new calling sequence now.
      
      Question:  The PyObject_NEW_VAR macro appears to be part of the public API.
      Regardless of what it expands to, the notion that it has to round up the
      memory it allocates is new, and extensions containing the old
      PyObject_NEW_VAR macro expansion (which was embedded in the
      PyObject_NEW_VAR expansion) won't do this rounding.  But the rounding
      isn't actually *needed* except for new-style instances with dict pointers
      after a variable-length blob of embedded data.  So my guess is that we do
      not need to bump the API version for this (as the rounding isn't needed
      for anything an extension can do unless it's recompiled anyway).  What's
      your guess?
      6d483d34
    • Tim Peters's avatar
      Repaired the debug Windows deaths in test_descr, by allocating enough · 406fe3b1
      Tim Peters yazdı
      pad memory to properly align the __dict__ pointer in all cases.
      
      gcmodule.c/objimpl.h, _PyObject_GC_Malloc:
      + Added a "padding" argument so that this flavor of malloc can allocate
        enough bytes for alignment padding (it can't know this is needed, but
        its callers do).
      
      typeobject.c, PyType_GenericAlloc:
      + Allocated enough bytes to align the __dict__ pointer.
      + Sped and simplified the round-up-to-PTRSIZE logic.
      + Added blank lines so I could parse the if/else blocks <0.7 wink>.
      406fe3b1
    • Tim Peters's avatar
      _PyObject_GetDictPtr(): · 7254e5a3
      Tim Peters yazdı
      + Use the _PyObject_VAR_SIZE macro to compute object size.
      + Break the computation into lines convenient for debugger inspection.
      + Speed the round-up-to-pointer-size computation.
      7254e5a3
    • Tim Peters's avatar
      _PyObject_GC_Malloc(): split a complicated line in two. As is, there was · 8c18f258
      Tim Peters yazdı
      no way to talk the debugger into showing me how many bytes were being
      allocated.
      8c18f258
    • Fred Drake's avatar
  4. 05 Eki, 2001 21 kayıt (commit)