1. 03 Ara, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, to · faad5ad5
      Tim Peters yazdı
      use wrappers on all platforms, to make this as consistent as possible x-
      platform (in particular, make sure there's at least one \0 byte in
      the output buffer).  Also document more of the truth about what these do.
      
      getargs.c, seterror():  Three computations of remaining buffer size were
      backwards, thus telling PyOS_snprintf the buffer is larger than it
      actually is.  This matters a lot now that PyOS_snprintf ensures there's a
      trailing \0 byte (because it didn't get the truth about the buffer size,
      it was storing \0 beyond the true end of the buffer).
      
      sysmodule.c, mywrite():  Simplify, now that PyOS_vsnprintf guarantees to
      produce a \0 byte.
      faad5ad5
  2. 28 Kas, 2001 1 kayıt (commit)
  3. 23 Eki, 2001 1 kayıt (commit)
  4. 05 Eki, 2001 1 kayıt (commit)
  5. 23 Agu, 2001 1 kayıt (commit)
  6. 31 Tem, 2001 3 kayıt (commit)
  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. 28 Şub, 2001 2 kayıt (commit)
  9. 15 Ara, 2000 1 kayıt (commit)
  10. 01 Eyl, 2000 2 kayıt (commit)
  11. 24 Agu, 2000 1 kayıt (commit)
  12. 08 Tem, 2000 1 kayıt (commit)
  13. 30 Haz, 2000 2 kayıt (commit)
  14. 10 Mar, 2000 1 kayıt (commit)
  15. 17 Şub, 2000 1 kayıt (commit)
  16. 22 Haz, 1999 1 kayıt (commit)
    • Guido van Rossum's avatar
      Patch by Tim Peters: · 87460821
      Guido van Rossum yazdı
      Introduce a new builtin exception, UnboundLocalError, raised when ceval.c
      tries to retrieve or delete a local name that isn't bound to a value.
      Currently raises NameError, which makes this behavior a FAQ since the same
      error is raised for "missing" global names too:  when the user has a global
      of the same name as the unbound local, NameError makes no sense to them.
      Even in the absence of shadowing, knowing whether a bogus name is local or
      global is a real aid to quick understanding.
      
      Example:
      
      D:\src\PCbuild>type local.py
      x = 42
      
      def f():
          print x
          x = 13
          return x
      
      f()
      
      D:\src\PCbuild>python local.py
      Traceback (innermost last):
        File "local.py", line 8, in ?
          f()
        File "local.py", line 4, in f
          print x
      UnboundLocalError: x
      
      D:\src\PCbuild>
      
      Note that UnboundLocalError is a subclass of NameError, for compatibility
      with existing class-exception code that may be trying to catch this as a
      NameError.  Unfortunately, I see no way to make this wholly compatible
      with -X (see comments in bltinmodule.c):  under -X, [UnboundLocalError
      is an alias for NameError --GvR].
      
      [The ceval.c patch differs slightly from the second version that Tim
      submitted; I decided not to raise UnboundLocalError for DELETE_NAME,
      only for DELETE_LOCAL.  DELETE_NAME is only generated at the module
      level, and since at that level a NameError is raised for referencing
      an undefined name, it should also be raised for deleting one.]
      87460821
  17. 04 Ara, 1998 1 kayıt (commit)
  18. 01 Ara, 1998 1 kayıt (commit)
  19. 23 Tem, 1998 1 kayıt (commit)
  20. 16 Eyl, 1997 3 kayıt (commit)
  21. 29 Agu, 1997 1 kayıt (commit)
  22. 22 Agu, 1997 1 kayıt (commit)
    • Barry Warsaw's avatar
      Three new C API functions: · c0dc92af
      Barry Warsaw yazdı
      - int PyErr_GivenExceptionMatches(obj1, obj2)
      
        Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
        instance of type obj2, or of a class derived from obj2
      
      - int PyErr_ExceptionMatches(obj)
      
        Higher level wrapper around PyErr_GivenExceptionMatches() which uses
        PyErr_Occurred() as obj1.  This will be the more commonly called
        function.
      
      - void PyErr_NormalizeException(typeptr, valptr, tbptr)
      
        Normalizes exceptions, and places the normalized values in the
        arguments.  If type is not a class, this does nothing.  If type is a
        class, then it makes sure that value is an instance of the class by:
      
        1. if instance is of the type, or a class derived from type, it does
           nothing.
      
        2. otherwise it instantiates the class, using the value as an
           argument.  If value is None, it uses an empty arg tuple, and if
           the value is a tuple, it uses just that.
      c0dc92af
  23. 02 Nis, 1997 1 kayıt (commit)
  24. 31 Mar, 1997 1 kayıt (commit)
  25. 14 Şub, 1997 2 kayıt (commit)
  26. 03 Ock, 1997 1 kayıt (commit)
  27. 10 Ara, 1996 1 kayıt (commit)
  28. 25 Eki, 1996 1 kayıt (commit)
  29. 27 Şub, 1995 1 kayıt (commit)
  30. 17 Ock, 1995 1 kayıt (commit)
  31. 12 Ock, 1995 1 kayıt (commit)
  32. 04 Ock, 1995 1 kayıt (commit)
    • Guido van Rossum's avatar
      Added 1995 copyright. · 5799b520
      Guido van Rossum yazdı
      object.h: made sizes and refcnts signed ints.
      stringobject.h: make getstrsize() signed int.
      methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
      5799b520