1. 22 May, 2001 1 kayıt (commit)
  2. 11 May, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Variant of SF patch 423181 · 1b0feb4a
      Jeremy Hylton yazdı
      For rich comparisons, use instance_getattr2() when possible to avoid
      the expense of setting an AttributeError.  Also intern the name_op[]
      table and use the interned strings rather than creating a new string
      and interning it each time through.
      1b0feb4a
  3. 05 May, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      Reimplement PySequence_Contains() and instance_contains(), so they work · cb8d368b
      Tim Peters yazdı
      safely together and don't duplicate logic (the common logic was factored
      out into new private API function _PySequence_IterContains()).
      Visible change:
          some_complex_number  in  some_instance
      no longer blows up if some_instance has __getitem__ but neither
      __contains__ nor __iter__.  test_iter changed to ensure that remains true.
      cb8d368b
  4. 03 May, 2001 1 kayıt (commit)
  5. 30 Nis, 2001 1 kayıt (commit)
  6. 23 Nis, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Mondo changes to the iterator stuff, without changing how Python code · 213c7a6a
      Guido van Rossum yazdı
      sees it (test_iter.py is unchanged).
      
      - Added a tp_iternext slot, which calls the iterator's next() method;
        this is much faster for built-in iterators over built-in types
        such as lists and dicts, speeding up pybench's ForLoop with about
        25% compared to Python 2.1.  (Now there's a good argument for
        iterators. ;-)
      
      - Renamed the built-in sequence iterator SeqIter, affecting the C API
        functions for it.  (This frees up the PyIter prefix for generic
        iterator operations.)
      
      - Added PyIter_Check(obj), which checks that obj's type has a
        tp_iternext slot and that the proper feature flag is set.
      
      - Added PyIter_Next(obj) which calls the tp_iternext slot.  It has a
        somewhat complex return condition due to the need for speed: when it
        returns NULL, it may not have set an exception condition, meaning
        the iterator is exhausted; when the exception StopIteration is set
        (or a derived exception class), it means the same thing; any other
        exception means some other error occurred.
      213c7a6a
  7. 20 Nis, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Iterators phase 1. This comprises: · 59d1d2b4
      Guido van Rossum yazdı
      new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER
      new C API PyObject_GetIter(), calls tp_iter
      new builtin iter(), with two forms: iter(obj), and iter(function, sentinel)
      new internal object types iterobject and calliterobject
      new exception StopIteration
      new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py)
      new magic number for .pyc files
      new special method for instances: __iter__() returns an iterator
      iteration over dictionaries: "for x in dict" iterates over the keys
      iteration over files: "for x in file" iterates over lines
      
      TODO:
      
      documentation
      test suite
      decide whether to use a different way to spell iter(function, sentinal)
      decide whether "for key in dict" is a good idea
      use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?)
      speed tuning (make next() a slot tp_next???)
      59d1d2b4
  8. 23 Mar, 2001 1 kayıt (commit)
  9. 22 Mar, 2001 1 kayıt (commit)
    • Fred Drake's avatar
      A small change to the C API for weakly-referencable types: Such types · 4e262a96
      Fred Drake yazdı
      must now initialize the extra field used by the weak-ref machinery to
      NULL themselves, to avoid having to require PyObject_INIT() to check
      if the type supports weak references and do it there.  This causes less
      work to be done for all objects (the type object does not need to be
      consulted to check for the Py_TPFLAGS_HAVE_WEAKREFS bit).
      4e262a96
  10. 26 Şub, 2001 2 kayıt (commit)
  11. 01 Şub, 2001 1 kayıt (commit)
  12. 29 Ock, 2001 2 kayıt (commit)
  13. 28 Ock, 2001 1 kayıt (commit)
  14. 18 Ock, 2001 1 kayıt (commit)
  15. 17 Ock, 2001 2 kayıt (commit)
    • Guido van Rossum's avatar
      Fix a leak in instance_coerce(). This was introduced by Neil's · 24f67d56
      Guido van Rossum yazdı
      earlier coercion changes, not by rich comparisons.  When a coercion
      function returns 1 (meaning it cannot do it), it should not INCREF the
      arguments.  When no __coerce__() method was found, instance_coerce()
      originally returned 0, pretending it did it.  Neil changed the return
      value to 1, more accurately reflecting that it didn't do anything, but
      forgot to take out the two INCREF calls.
      24f67d56
    • Guido van Rossum's avatar
      Rich comparisons. · 8998b4f6
      Guido van Rossum yazdı
      - Got rid of instance_cmp(); refactored instance_compare().
      
      - Added instance_richcompare() which calls __lt__() etc.
      
      Some unrelated stuff mixed in:
      
      - Aligned comments in various large struct initializers.
      
      - Better test to avoid recursion if __coerce__ returns self as the
        first argument (this is an unrelated fix by Neil Schemenauer!).
      
      - Style nit: don't use Py_DECREF(Py_NotImplemented); use
        Py_DECREF(result) -- it just looks better. :-)
      8998b4f6
  16. 15 Ock, 2001 1 kayıt (commit)
    • Barry Warsaw's avatar
      Committing PEP 232, function attribute feature, approved by Guido. · d6a9e84c
      Barry Warsaw yazdı
      Closes SF patch #103123.
      
      funcobject.h:
      
          PyFunctionObject: add the func_dict slot.
      
      funcobject.c:
      
          PyFunction_New(): Initialize the func_dict slot to NULL.
      
          func_getattr(): Rename to func_getattro() and change the
          signature.  It's more efficient to use attro methods and dig the C
          string out than it is to re-convert a C string to a PyString.
      
          Also, add support for getting the __dict__ (a.k.a. func_dict)
          attribute, and for getting an arbitrary function attribute.
      
          func_setattr(): Rename to func_setattro() and change the signature
          for the same reason.  Also add support for setting __dict__
          (a.k.a. func_dict) and any arbitrary function attribute.
      
          func_dealloc(): Be sure to DECREF the func_dict slot.
      
          func_traverse(): Be sure to traverse func_dict too.
      
          PyFunction_Type: make the necessary func_?etattro() changes.
      
      classobject.c:
      
          instancemethod_memberlist: Add __dict__
      
          instancemethod_setattro(): New method to set arbitrary attributes
          on methods (really the underlying im_func).  Raise TypeError when
          the instance is bound or when you're trying to set one of the
          reserved im_* attributes.
      
          instancemethod_getattr(): Renamed to instancemethod_getattro()
          since that's what it really is.  Also, added support fo getting
          arbitrary attributes through the im_func.
      
          PyMethod_Type: Do the ?etattr{,o} dance.
      d6a9e84c
  17. 04 Ock, 2001 1 kayıt (commit)
  18. 24 Eki, 2000 1 kayıt (commit)
    • Fred Drake's avatar
      Ka-Ping Yee <ping@lfw.org>: · 661ea26b
      Fred Drake yazdı
      Changes to error messages to increase consistency & clarity.
      
      This (mostly) closes SourceForge patch #101839.
      661ea26b
  19. 04 Eki, 2000 1 kayıt (commit)
  20. 17 Eyl, 2000 1 kayıt (commit)
    • Tim Peters's avatar
      Fix for SF bug 110688: Instance deallocation neglected to account for · 6b184918
      Tim Peters yazdı
      that Py_INCREF boosts global _Py_RefTotal when Py_REF_DEBUG is defined
      but Py_TRACE_REFS isn't.
      
      There are, IMO, way too many preprocessor gimmicks in use for refcount
      debugging (at least 3 distinct true/false symbols, but not all 8 combos
      are supported by the code, etc etc), and no coherent documentation of
      this stuff -- 'twas too painful to track this one down.
      6b184918
  21. 15 Eyl, 2000 1 kayıt (commit)
  22. 01 Eyl, 2000 2 kayıt (commit)
  23. 25 Agu, 2000 1 kayıt (commit)
  24. 24 Agu, 2000 1 kayıt (commit)
  25. 18 Agu, 2000 1 kayıt (commit)
  26. 17 Agu, 2000 1 kayıt (commit)
  27. 23 Tem, 2000 1 kayıt (commit)
  28. 16 Tem, 2000 1 kayıt (commit)
    • Thomas Wouters's avatar
      Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either · 7e474022
      Thomas Wouters yazdı
      comments, docstrings or error messages. I fixed two minor things in
      test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").
      
      There is a minor style issue involved: Guido seems to have preferred English
      grammar (behaviour, honour) in a couple places. This patch changes that to
      American, which is the more prominent style in the source. I prefer English
      myself, so if English is preferred, I'd be happy to supply a patch myself ;)
      7e474022
  29. 09 Tem, 2000 2 kayıt (commit)
  30. 08 Tem, 2000 1 kayıt (commit)
  31. 01 Tem, 2000 1 kayıt (commit)
  32. 30 Haz, 2000 4 kayıt (commit)
    • Guido van Rossum's avatar
      Change copyright notice - 2nd try. · ffcc3813
      Guido van Rossum yazdı
      ffcc3813
    • Guido van Rossum's avatar
      Change copyright notice. · fd71b9e9
      Guido van Rossum yazdı
      fd71b9e9
    • Fred Drake's avatar
      Trent Mick <trentm@activestate.com>: · a44d353e
      Fred Drake yazdı
      The common technique for printing out a pointer has been to cast to a long
      and use the "%lx" printf modifier. This is incorrect on Win64 where casting
      to a long truncates the pointer. The "%p" formatter should be used instead.
      
      The problem as stated by Tim:
      > Unfortunately, the C committee refused to define what %p conversion "looks
      > like" -- they explicitly allowed it to be implementation-defined. Older
      > versions of Microsoft C even stuck a colon in the middle of the address (in
      > the days of segment+offset addressing)!
      
      The result is that the hex value of a pointer will maybe/maybe not have a 0x
      prepended to it.
      
      
      Notes on the patch:
      
      There are two main classes of changes:
      - in the various repr() functions that print out pointers
      - debugging printf's in the various thread_*.h files (these are why the
      patch is large)
      
      
      Closes SourceForge patch #100505.
      a44d353e
    • Jeremy Hylton's avatar