1. 19 Eki, 2001 6 kayıt (commit)
    • Guido van Rossum's avatar
      1c486099
    • Guido van Rossum's avatar
      SF patch #470578: Fixes to synchronize unicode() and str() · b8c65bc2
      Guido van Rossum yazdı
          This patch implements what we have discussed on python-dev late in
          September: str(obj) and unicode(obj) should behave similar, while
          the old behaviour is retained for unicode(obj, encoding, errors).
      
          The patch also adds a new feature with which objects can provide
          unicode(obj) with input data: the __unicode__ method. Currently no
          new tp_unicode slot is implemented; this is left as option for the
          future.
      
          Note that PyUnicode_FromEncodedObject() no longer accepts Unicode
          objects as input. The API name already suggests that Unicode
          objects do not belong in the list of acceptable objects and the
          functionality was only needed because
          PyUnicode_FromEncodedObject() was being used directly by
          unicode(). The latter was changed in the discussed way:
      
          * unicode(obj) calls PyObject_Unicode()
          * unicode(obj, encoding, errors) calls PyUnicode_FromEncodedObject()
      
          One thing left open to discussion is whether to leave the
          PyUnicode_FromObject() API as a thin API extension on top of
          PyUnicode_FromEncodedObject() or to turn it into a (macro) alias
          for PyObject_Unicode() and deprecate it. Doing so would have some
          surprising consequences though, e.g.  u"abc" + 123 would turn out
          as u"abc123"...
      
      [Marc-Andre didn't have time to check this in before the deadline.  I
      hope this is OK, Marc-Andre!  You can still make changes and commit
      them on the trunk after the branch has been made, but then please mail
      Barry a context diff if you want the change to be merged into the
      2.2b1 release branch.  GvR]
      b8c65bc2
    • Guido van Rossum's avatar
      Another. · 93505a2f
      Guido van Rossum yazdı
      93505a2f
    • Guido van Rossum's avatar
      SF patch #470393 (Jim Ahlstrom): Add missing marshal function · b8cf3e64
      Guido van Rossum yazdı
          In Include/, marshal.h declares both
          PyMarshal_ReadLongFromFile()
          and PyMarshal_ReadShortFromFile(),
          but the second is missing from marshal.c.
      
      [Shouldn't the return type be declared as 'short' instead of 'int'?
      But 'int' is what was in marshal.h all those years...  --Guido]
      b8cf3e64
    • Guido van Rossum's avatar
      SF patch #460805 by Chris Gonnerman: Support for unsetenv() · c524d952
      Guido van Rossum yazdı
      This adds unsetenv to posix, and uses it in the __delitem__ method of
      os.environ.
      
      (XXX Should we change the preferred name for putenv to setenv, for
      consistency?)
      c524d952
    • Guido van Rossum's avatar
      SF patch #443759: Add Interface to readline's add_history · b6c1d523
      Guido van Rossum yazdı
      This was submitted by Moshe, but apparently he's too busy to check it
      in himself.  He wrote:
      
          Here is a function in GNU readline called add_history,
          which is used to manage the history list. Though Python
          uses this function internally, it does not expose it to
          the Python programmer. This patch adds direct interface
          to this function with documentation.
      
          This could be used by friendly modules to "seed" the
          history with commands.
      b6c1d523
  2. 18 Eki, 2001 34 kayıt (commit)