diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-30 19:44:54 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-30 19:44:54 (GMT) |
commit | d12362a828a57bc8eff8f0efe85aad7672cc9b85 (patch) | |
tree | 0356c975064b6350efcf62be39b8045cb7ca8085 /Doc/c-api/structures.rst | |
parent | 9abe1f1159079445e88cd13d45d5fcc432bb8ce5 (diff) | |
download | cpython-d12362a828a57bc8eff8f0efe85aad7672cc9b85.zip cpython-d12362a828a57bc8eff8f0efe85aad7672cc9b85.tar.gz cpython-d12362a828a57bc8eff8f0efe85aad7672cc9b85.tar.bz2 |
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.
........
Diffstat (limited to 'Doc/c-api/structures.rst')
-rw-r--r-- | Doc/c-api/structures.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 87bd362..9f6a5e2 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -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 |