1. 20 Eki, 2003 1 kayıt (commit)
  2. 12 May, 2003 1 kayıt (commit)
  3. 28 Şub, 2003 1 kayıt (commit)
  4. 25 Kas, 2002 1 kayıt (commit)
  5. 12 Agu, 2002 1 kayıt (commit)
  6. 08 May, 2002 1 kayıt (commit)
  7. 05 Ock, 2002 1 kayıt (commit)
  8. 28 Kas, 2001 1 kayıt (commit)
  9. 09 Kas, 2001 1 kayıt (commit)
  10. 28 Eki, 2001 1 kayıt (commit)
  11. 26 Eki, 2001 2 kayıt (commit)
    • Fred Drake's avatar
      Added two new functions to conveniently call functions/methods from C. · b421b8c1
      Fred Drake yazdı
      PyObject_CallFunctionObArgs() and PyObject_CallMethodObArgs() have the
      advantage that no format strings need to be parsed.  The CallMethod
      variant also avoids creating a new string object in order to retrieve
      a method from an object as well.
      b421b8c1
    • Tim Peters's avatar
      Generalize dictionary() to accept a sequence of 2-sequences. At the · 1fc240e8
      Tim Peters yazdı
      outer level, the iterator protocol is used for memory-efficiency (the
      outer sequence may be very large if fully materialized); at the inner
      level, PySequence_Fast() is used for time-efficiency (these should
      always be sequences of length 2).
      
      dictobject.c, new functions PyDict_{Merge,Update}FromSeq2.  These are
      wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2-
      sequences argument instead of a mapping object.  For now, I left these
      functions file static, so no corresponding doc changes.  It's tempting
      to change dict.update() to allow a sequence-of-2-seqs argument too.
      
      Also changed the name of dictionary's keyword argument from "mapping"
      to "x".  Got a better name?  "mapping_or_sequence_of_pairs" isn't
      attractive, although more so than "mosop" <wink>.
      
      abstract.h, abstract.tex:  Added new PySequence_Fast_GET_SIZE function,
      much faster than going thru the all-purpose PySequence_Size.
      
      libfuncs.tex:
      - Document dictionary().
      - Fiddle tuple() and list() to admit that their argument is optional.
      - The long-winded repetitions of "a sequence, a container that supports
        iteration, or an iterator object" is getting to be a PITA.  Many
        months ago I suggested factoring this out into "iterable object",
        where the definition of that could include being explicit about
        generators too (as is, I'm not sure a reader outside of PythonLabs
        could guess that "an iterator object" includes a generator call).
      - Please check my curly braces -- I'm going blind <0.9 wink>.
      
      abstract.c, PySequence_Tuple():  When PyObject_GetIter() fails, leave
      its error msg alone now (the msg it produces has improved since
      PySequence_Tuple was generalized to accept iterable objects, and
      PySequence_Tuple was also stomping on the msg in cases it shouldn't
      have even before PyObject_GetIter grew a better msg).
      1fc240e8
  12. 08 Eyl, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      Generalize operator.indexOf (PySequence_Index) to work with any · 16a77adf
      Tim Peters yazdı
      iterable object.  I'm not sure how that got overlooked before!
      
      Got rid of the internal _PySequence_IterContains, introduced a new
      internal _PySequence_IterSearch, and rewrote all the iteration-based
      "count of", "index of", and "is the object in it or not?" routines to
      just call the new function.  I suppose it's slower this way, but the
      code duplication was getting depressing.
      16a77adf
  13. 08 Agu, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Implement PEP 238 in its (almost) full glory. · 4668b000
      Guido van Rossum yazdı
      This introduces:
      
      - A new operator // that means floor division (the kind of division
        where 1/2 is 0).
      
      - The "future division" statement ("from __future__ import division)
        which changes the meaning of the / operator to implement "true
        division" (where 1/2 is 0.5).
      
      - New overloadable operators __truediv__ and __floordiv__.
      
      - New slots in the PyNumberMethods struct for true and floor division,
        new abstract APIs for them, new opcodes, and so on.
      
      I emphasize that without the future division statement, the semantics
      of / will remain unchanged until Python 3.0.
      
      Not yet implemented are warnings (default off) when / is used with int
      or long arguments.
      
      This has been on display since 7/31 as SF patch #443474.
      
      Flames to /dev/null.
      4668b000
  14. 02 Agu, 2001 1 kayıt (commit)
  15. 05 May, 2001 3 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
    • Tim Peters's avatar
      Generalize tuple() to work nicely with iterators. · 6912d4dd
      Tim Peters yazdı
      NEEDS DOC CHANGES.
      This one surprised me!  While I expected tuple() to be a no-brainer, turns
      out it's actually dripping with consequences:
      1. It will *allow* the popular PySequence_Fast() to work with any iterable
         object (code for that not yet checked in, but should be trivial).
      2. It caused two std tests to fail.  This because some places used
         PyTuple_Sequence() (the C spelling of tuple()) as an indirect way to test
         whether something *is* a sequence.  But tuple() code only looked for the
         existence of sq->item to determine that, and e.g. an instance passed
         that test whether or not it supported the other operations tuple()
         needed (e.g., __len__).  So some things the tests *expected* to fail
         with an AttributeError now fail with a TypeError instead.  This looks
         like an improvement to me; e.g., test_coercion used to produce 559
         TypeErrors and 2 AttributeErrors, and now they're all TypeErrors.  The
         error details are more informative too, because the places calling this
         were *looking* for TypeErrors in order to replace the generic tuple()
         "not a sequence" msg with their own more specific text, and
         AttributeErrors snuck by that.
      6912d4dd
    • Tim Peters's avatar
      Make PyIter_Next() a little smarter (wrt its knowledge of iterator · f4848dac
      Tim Peters yazdı
      internals) so clients can be a lot dumber (wrt their knowledge).
      f4848dac
  16. 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
  17. 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
  18. 21 Mar, 2001 1 kayıt (commit)
  19. 17 Ock, 2001 1 kayıt (commit)
  20. 24 Agu, 2000 1 kayıt (commit)
  21. 03 Agu, 2000 1 kayıt (commit)
  22. 17 Tem, 2000 1 kayıt (commit)
  23. 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
  24. 13 Tem, 2000 1 kayıt (commit)
  25. 12 Tem, 2000 1 kayıt (commit)
  26. 09 Tem, 2000 1 kayıt (commit)
  27. 30 Haz, 2000 2 kayıt (commit)
  28. 18 Haz, 2000 1 kayıt (commit)
    • Andrew M. Kuchling's avatar
      Patch from /F: · 74042d6e
      Andrew M. Kuchling yazdı
      this patch introduces PySequence_Fast and PySequence_Fast_GET_ITEM,
      and modifies the list.extend method to accept any kind of sequence.
      74042d6e
  29. 10 Mar, 2000 1 kayıt (commit)
  30. 17 Mar, 1999 1 kayıt (commit)
  31. 04 Ara, 1998 1 kayıt (commit)
  32. 23 Agu, 1998 1 kayıt (commit)
  33. 22 May, 1998 1 kayıt (commit)
  34. 09 Nis, 1998 1 kayıt (commit)
  35. 04 Mar, 1997 1 kayıt (commit)
  36. 14 Şub, 1997 1 kayıt (commit)