1. 19 Haz, 2005 1 kayıt (commit)
  2. 30 Mar, 2005 1 kayıt (commit)
    • Michael W. Hudson's avatar
      Fix for rather inaccurately titled bug · e2749cb2
      Michael W. Hudson yazdı
      [ 1165306 ] Property access with decorator makes interpreter crash
      
      Don't allow the creation of unbound methods with NULL im_class, because
      attempting to call such crashes.
      
      Backport candidate.
      e2749cb2
  3. 23 Eyl, 2004 1 kayıt (commit)
  4. 03 Agu, 2004 1 kayıt (commit)
  5. 22 Kas, 2003 1 kayıt (commit)
    • Guido van Rossum's avatar
      - When method objects have an attribute that can be satisfied either · baf0f8f2
      Guido van Rossum yazdı
        by the function object or by the method object, the function
        object's attribute usually wins.  Christian Tismer pointed out that
        that this is really a mistake, because this only happens for special
        methods (like __reduce__) where the method object's version is
        really more appropriate than the function's attribute.  So from now
        on, all method attributes will have precedence over function
        attributes with the same name.
      baf0f8f2
  6. 28 Eki, 2003 1 kayıt (commit)
  7. 12 Eki, 2003 1 kayıt (commit)
  8. 16 Eyl, 2003 1 kayıt (commit)
  9. 09 Nis, 2003 1 kayıt (commit)
  10. 07 Nis, 2003 1 kayıt (commit)
  11. 11 Şub, 2003 1 kayıt (commit)
  12. 29 Ara, 2002 1 kayıt (commit)
  13. 12 Ara, 2002 2 kayıt (commit)
  14. 29 Eki, 2002 1 kayıt (commit)
  15. 18 Eki, 2002 1 kayıt (commit)
  16. 20 Agu, 2002 1 kayıt (commit)
  17. 19 Agu, 2002 1 kayıt (commit)
    • Guido van Rossum's avatar
      SF patch 576101, by Oren Tirosh: alternative implementation of · 45ec02ae
      Guido van Rossum yazdı
      interning.  I modified Oren's patch significantly, but the basic idea
      and most of the implementation is unchanged.  Interned strings created
      with PyString_InternInPlace() are now mortal, and you must keep a
      reference to the resulting string around; use the new function
      PyString_InternImmortal() to create immortal interned strings.
      45ec02ae
  18. 11 Tem, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      object.h special-build macro minefield: renamed all the new lexical · 3459251d
      Tim Peters yazdı
      helper macros to something saner, and used them appropriately in other
      files too, to reduce #ifdef blocks.
      
      classobject.c, instance_dealloc():  One of my worst Python Memories is
      trying to fix this routine a few years ago when COUNT_ALLOCS was defined
      but Py_TRACE_REFS wasn't.  The special-build code here is way too
      complicated.  Now it's much simpler.  Difference:  in a Py_TRACE_REFS
      build, the instance is no longer in the doubly-linked list of live
      objects while its __del__ method is executing, and that may be visible
      via sys.getobjects() called from a __del__ method.  Tough -- the object
      is presumed dead while its __del__ is executing anyway, and not calling
      _Py_NewReference() at the start allows enormous code simplification.
      
      typeobject.c, call_finalizer():  The special-build instance_dealloc()
      pain apparently spread to here too via cut-'n-paste, and this is much
      simpler now too.  In addition, I didn't understand why this routine
      was calling _PyObject_GC_TRACK() after a resurrection, since there's no
      plausible way _PyObject_GC_UNTRACK() could have been called on the
      object by this point.  I suspect it was left over from pasting the
      instance_delloc() code.  Instead asserted that the object is still
      tracked.  Caution:  I suspect we don't have a test that actually
      exercises the subtype_dealloc() __del__-resurrected-me code.
      3459251d
  19. 07 Tem, 2002 1 kayıt (commit)
  20. 18 Haz, 2002 1 kayıt (commit)
  21. 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
  22. 13 Haz, 2002 2 kayıt (commit)
    • Guido van Rossum's avatar
      Major cleanup operation: whenever there's a call that looks for an · e7b8ecf1
      Guido van Rossum yazdı
      optional attribute, only clear the exception when the internal getattr
      operation raised AttributeError.  Many places in this file already had
      that policy; but just as many didn't, and there didn't seem to be any
      rhyme or reason to it.  Be consistently cautious.
      
      Question: should I backport this?  On the one hand it's a bugfix.  On
      the other hand it's a change in behavior.  Certain forms of buggy or
      just weird code would work in the past but raise an exception under
      the new rules; e.g. if you define a __getattr__ method that raises a
      non-AttributeError exception.
      e7b8ecf1
    • Guido van Rossum's avatar
      Fix for SF bug 532646. This is a little simpler than what Neal · 16b93b3d
      Guido van Rossum yazdı
      suggested there, based upon a better analysis (__getattr__ is a red
      herring).  Will backport to 2.2.
      16b93b3d
  23. 26 Eki, 2001 1 kayıt (commit)
  24. 22 Eki, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Fix for SF bug #472940: can't getattr() attribute shown by dir() · 56ff387a
      Guido van Rossum yazdı
      There really isn't a good reason for instance method objects to have
      their own __dict__, __doc__ and __name__ properties that just delegate
      the request to the function (callable); the default attribute behavior
      already does this.
      
      The test suite had to be fixed because the error changes from
      TypeError to AttributeError.
      56ff387a
  25. 17 Eki, 2001 1 kayıt (commit)
  26. 30 Eyl, 2001 1 kayıt (commit)
  27. 20 Eyl, 2001 2 kayıt (commit)
    • Guido van Rossum's avatar
      Add optional docstrings to getset descriptors. Fortunately, there's · 32d34c80
      Guido van Rossum yazdı
      no backwards compatibility to worry about, so I just pushed the
      'closure' struct member to the back -- it's never used in the current
      code base (I may eliminate it, but that's more work because the getter
      and setter signatures would have to change.)
      
      As examples, I added actual docstrings to the getset attributes of a
      few types: file.closed, xxsubtype.spamdict.state.
      32d34c80
    • Guido van Rossum's avatar
      Add optional docstrings to member descriptors. For backwards · 6f799376
      Guido van Rossum yazdı
      compatibility, this required all places where an array of "struct
      memberlist" structures was declared that is referenced from a type's
      tp_members slot to change the type of the structure to PyMemberDef;
      "struct memberlist" is now only used by old code that still calls
      PyMember_Get/Set.  The code in PyObject_GenericGetAttr/SetAttr now
      calls the new APIs PyMember_GetOne/SetOne, which take a PyMemberDef
      argument.
      
      As examples, I added actual docstrings to the attributes of a few
      types: file, complex, instance method, super, and xxsubtype.spamlist.
      
      Also converted the symtable to new style getattr.
      6f799376
  28. 18 Eyl, 2001 2 kayıt (commit)
    • Martin v. Löwis's avatar
      cf95f9ca
    • Guido van Rossum's avatar
      Redo the PyMethod attributes using a dir()-friendly approach, creating · f0b35e15
      Guido van Rossum yazdı
      descriptors for each attribute.  The getattr() implementation is
      similar to PyObject_GenericGetAttr(), but delegates to im_self instead
      of looking in __dict__; I couldn't do this as a wrapper around
      PyObject_GenericGetAttr().
      
      XXX A problem here is that this is a case of *delegation*.  dir()
      doesn't see exactly the same attributes that are actually defined;
      e.g. if the delegate is a Python function object, it supports
      attributes like func_code etc., but these are not visible to dir(); on
      the other hand, dynamic function attributes (stored in the function's
      __dict__) *are* visible to dir().  Maybe we need a mechanism to tell
      dir() about the delegation mechanism?  I vaguely recall seeing a
      request in the newsgroup for a more formal definition of attribute
      delegation too.  Sigh, time for a new PEP.
      f0b35e15
  29. 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
  30. 07 Eyl, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      PyClass_New(): put the extended Don Beaudry hook back in. When one of · 28d80b10
      Guido van Rossum yazdı
      the base classes is not a classic class, and its class (the metaclass)
      is callable, call the metaclass to do the deed.
      
      One effect of this is that, when mixing classic and new-style classes
      amongst the bases of a class, it doesn't matter whether the first base
      class is a classic class or not: you will always get the error
      "TypeError: metatype conflict among bases".  (Formerly, with a classic
      class first, you'd get "TypeError: PyClass_New: base must be a class".)
      
      Another effect is that multiple inheritance from ExtensionClass.Base,
      with a classic class as the first class, transfers control to the
      ExtensionClass.Base class.  This is what we need for SF #443239 (and
      also for running Zope under 2.2a4, before ExtensionClass is replaced).
      28d80b10
  31. 05 Eyl, 2001 1 kayıt (commit)
  32. 29 Agu, 2001 1 kayıt (commit)
  33. 24 Agu, 2001 2 kayıt (commit)
  34. 17 Agu, 2001 2 kayıt (commit)