1. 26 Eki, 2002 1 kayıt (commit)
  2. 27 Agu, 2002 1 kayıt (commit)
  3. 16 Agu, 2002 1 kayıt (commit)
    • Guido van Rossum's avatar
      A nice little speed-up for filter(): · c7903a13
      Guido van Rossum yazdı
      - Use PyObject_Call() instead of PyEval_CallObject(), saves several
        layers of calls and checks.
      
      - Pre-allocate the argument tuple rather than calling Py_BuildValue()
        each time round the loop.
      
      - For filter(None, seq), avoid an INCREF and a DECREF.
      c7903a13
  4. 14 Agu, 2002 1 kayıt (commit)
  5. 11 Agu, 2002 1 kayıt (commit)
  6. 30 Haz, 2002 1 kayıt (commit)
  7. 14 Haz, 2002 1 kayıt (commit)
    • Guido van Rossum's avatar
      SF patch 568629 by Oren Tirosh: types made callable. · bea18ccd
      Guido van Rossum yazdı
      These built-in functions are replaced by their (now callable) type:
      
          slice()
          buffer()
      
      and these types can also be called (but have no built-in named
      function named after them)
      
          classobj (type name used to be "class")
          code
          function
          instance
          instancemethod (type name used to be "instance method")
      
      The module "new" has been replaced with a small backward compatibility
      placeholder in Python.
      
      A large portion of the patch simply removes the new module from
      various platform-specific build recipes.  The following binary Mac
      project files still have references to it:
      
          Mac/Build/PythonCore.mcp
          Mac/Build/PythonStandSmall.mcp
          Mac/Build/PythonStandalone.mcp
      
      [I've tweaked the code layout and the doc strings here and there, and
      added a comment to types.py about StringTypes vs. basestring.  --Guido]
      bea18ccd
  8. 13 Haz, 2002 1 kayıt (commit)
  9. 05 Haz, 2002 1 kayıt (commit)
  10. 31 May, 2002 1 kayıt (commit)
  11. 24 May, 2002 1 kayıt (commit)
  12. 12 May, 2002 1 kayıt (commit)
  13. 29 Nis, 2002 1 kayıt (commit)
  14. 27 Nis, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Repair widespread misuse of _PyString_Resize. Since it's clear people · 5de9842b
      Tim Peters yazdı
      don't understand how this function works, also beefed up the docs.  The
      most common usage error is of this form (often spread out across gotos):
      
      	if (_PyString_Resize(&s, n) < 0) {
      		Py_DECREF(s);
      		s = NULL;
      		goto outtahere;
      	}
      
      The error is that if _PyString_Resize runs out of memory, it automatically
      decrefs the input string object s (which also deallocates it, since its
      refcount must be 1 upon entry), and sets s to NULL.  So if the "if"
      branch ever triggers, it's an error to call Py_DECREF(s):  s is already
      NULL!  A correct way to write the above is the simpler (and intended)
      
      	if (_PyString_Resize(&s, n) < 0)
      		goto outtahere;
      
      Bugfix candidate.
      5de9842b
  15. 26 Nis, 2002 1 kayıt (commit)
  16. 14 Nis, 2002 1 kayıt (commit)
    • Jack Jansen's avatar
      Mass checkin of universal newline support. · 7b8c7546
      Jack Jansen yazdı
      Highlights: import and friends will understand any of \r, \n and \r\n
      as end of line. Python file input will do the same if you use mode 'U'.
      Everything can be disabled by configuring with --without-universal-newlines.
      
      See PEP278 for details.
      7b8c7546
  17. 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
  18. 09 Mar, 2002 2 kayıt (commit)
  19. 12 Ock, 2002 1 kayıt (commit)
  20. 13 Ara, 2001 1 kayıt (commit)
  21. 28 Kas, 2001 1 kayıt (commit)
  22. 05 Kas, 2001 1 kayıt (commit)
  23. 29 Eki, 2001 1 kayıt (commit)
  24. 24 Eki, 2001 1 kayıt (commit)
  25. 16 Eki, 2001 1 kayıt (commit)
  26. 07 Eki, 2001 1 kayıt (commit)
  27. 13 Eyl, 2001 3 kayıt (commit)
  28. 06 Eyl, 2001 1 kayıt (commit)
  29. 05 Eyl, 2001 1 kayıt (commit)
  30. 04 Eyl, 2001 2 kayıt (commit)
    • Tim Peters's avatar
      At Guido's suggestion, here's a new C API function, PyObject_Dir(), like · 7eea37e8
      Tim Peters yazdı
      __builtin__.dir().  Moved the guts from bltinmodule.c to object.c.
      7eea37e8
    • Tim Peters's avatar
      builtin_dir(): Treat classic classes like types. Use PyDict_Keys instead · 37a309db
      Tim Peters yazdı
      of PyMapping_Keys because we know we have a real dict.  Tolerate that
      objects may have an attr named "__dict__" that's not a dict (Py_None
      popped up during testing).
      
      test_descr.py, test_dir():  Test the new classic-class behavior; beef up
      the new-style class test similarly.
      
      test_pyclbr.py, checkModule():  dir(C) is no longer a synonym for
      C.__dict__.keys() when C is a classic class (looks like the same thing
      that burned distutils! -- should it be *made* a synoym again?  Then it
      would be inconsistent with new-style class behavior.).
      37a309db
  31. 03 Eyl, 2001 1 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
  32. 24 Agu, 2001 1 kayıt (commit)
  33. 23 Agu, 2001 1 kayıt (commit)
  34. 17 Agu, 2001 3 kayıt (commit)