Merged revisions 77161 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r77161 | benjamin.peterson | 2009-12-30 13:44:54 -0600 (Wed, 30 Dec 2009) | 12 lines

  Merged revisions 77157 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r77157 | benjamin.peterson | 2009-12-30 13:34:10 -0600 (Wed, 30 Dec 2009) | 5 lines

    check if the attribute is set before deleting it with T_OBJECT_EX (fixes #7604)

    Also, add a note to the docs about the better behavior of T_OBJECT_EX as
    compared to T_OBJECT.
  ........
................
This commit is contained in:
Benjamin Peterson 2009-12-30 19:47:05 +00:00
parent 078d2c9c5f
commit 533849a27a
4 changed files with 27 additions and 6 deletions

View file

@ -273,7 +273,10 @@ definition with the same method name.
:cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that
:cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and
:cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`.
:cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use
:cmacro:`T_OBJECT_EX` over :cmacro:`T_OBJECT` because :cmacro:`T_OBJECT_EX`
handles use of the :stmt:`del` statement on that attribute more correctly
than :cmacro:`T_OBJECT`.
:attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for
read-only access. Using :cmacro:`T_STRING` for :attr:`type` implies