Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2fd42739
Commit
2fd42739
authored
Sep 30, 2004
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the way __doc__ is managed to get backward compatible behavior.
parent
9bcc66f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
lib/python/ExtensionClass/_ExtensionClass.c
lib/python/ExtensionClass/_ExtensionClass.c
+9
-0
lib/python/ExtensionClass/tests.py
lib/python/ExtensionClass/tests.py
+19
-0
No files found.
lib/python/ExtensionClass/_ExtensionClass.c
View file @
2fd42739
...
...
@@ -308,6 +308,15 @@ EC_init(PyTypeObject *self, PyObject *args, PyObject *kw)
if
(
PyType_Type
.
tp_init
(
OBJECT
(
self
),
args
,
kw
)
<
0
)
return
-
1
;
if
(
self
->
tp_dict
!=
NULL
)
{
r
=
PyDict_GetItemString
(
self
->
tp_dict
,
"__doc__"
);
if
((
r
==
Py_None
)
&&
(
PyDict_DelItemString
(
self
->
tp_dict
,
"__doc__"
)
<
0
)
)
return
-
1
;
}
/* set up __get__, if necessary */
if
(
self
->
tp_descr_get
!=
of_get
)
{
...
...
lib/python/ExtensionClass/tests.py
View file @
2fd42739
...
...
@@ -170,6 +170,8 @@ def test__basicnew__():
{}
"""
def
cmpattrs
(
self
,
other
,
*
attrs
):
for
attr
in
attrs
:
if
attr
[:
3
]
in
(
'_v_'
,
'_p_'
):
...
...
@@ -690,6 +692,23 @@ def test_of_not_called_when_not_accessed_through_EC_instance():
"""
def
test_inheriting___doc__
():
"""Old-style ExtensionClass inherited __doc__ from base classes.
>>> class E(Base):
... "eek"
>>> class EE(E):
... pass
>>> EE.__doc__
'eek'
>>> EE().__doc__
'eek'
"""
from
doctest
import
DocTestSuite
import
unittest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment