1. 26 Apr, 2002 4 commits
    • Guido van Rossum's avatar
      PyNumber_CoerceEx: this took a shortcut (not doing anything) when the · 517c7d4f
      Guido van Rossum authored
      left and right type were of the same type and not classic instances.
      
      This shortcut is dangerous for proxy types, because it means that
      coerce(Proxy(1), Proxy(2.1)) leaves Proxy(1) unchanged rather than
      turning it into Proxy(1.0).
      
      In an ever-so-slight change of semantics, I now only take the shortcut
      when the left and right types are of the same type and don't have the
      CHECKTYPES feature.  It so happens that classic instances have this
      flag, so the shortcut is still skipped in this case (i.e. nothing
      changes for classic instances).  Proxies also have this flag set
      (otherwise implementing numeric operations on proxies would become
      nightmarish) and this means that the shortcut is also skipped there,
      as desired.  It so happens that int, long and float also have this
      flag set; that means that e.g. coerce(1, 1) will now invoke
      int_coerce().  This is fine: int_coerce() can deal with this, and I'm
      not worried about the performance; int_coerce() is only invoked when
      the user explicitly calls coerce(), which should be rarer than rare.
      517c7d4f
    • Fred Drake's avatar
      Clean up uses of some deprecated features. · d451ec1c
      Fred Drake authored
      Reported by Neal Norwitz on python-dev.
      d451ec1c
    • Neil Schemenauer's avatar
      If Py_OptimizeFlag is false then always evaluate assert conditions, don't · 89e3ee0c
      Neil Schemenauer authored
      test __debug__ at runtime.  Closes SF patch #548833.
      89e3ee0c
    • Guido van Rossum's avatar
      Make sure that tp_free frees the int the same way as tp_dealloc would. · 93646981
      Guido van Rossum authored
      This fixes the problem that Barry reported on python-dev:
         >>> 23000 .__class__ = bool
      crashes in the deallocator.  This was because int inherited tp_free
      from object, which uses the default allocator.
      
      2.2. Bugfix candidate.
      93646981
  2. 25 Apr, 2002 9 commits
  3. 24 Apr, 2002 3 commits
  4. 23 Apr, 2002 24 commits