File tree 1 file changed +22
-19
lines changed
1 file changed +22
-19
lines changed Original file line number Diff line number Diff line change 9
9
import pydoc
10
10
from warnings import warn
11
11
import collections
12
+ import copy
12
13
import sys
13
14
14
15
@@ -97,30 +98,32 @@ def __str__(self):
97
98
98
99
99
100
class NumpyDocString (collections .Mapping ):
101
+ sections = {
102
+ 'Signature' : '' ,
103
+ 'Summary' : ['' ],
104
+ 'Extended Summary' : [],
105
+ 'Parameters' : [],
106
+ 'Returns' : [],
107
+ 'Yields' : [],
108
+ 'Raises' : [],
109
+ 'Warns' : [],
110
+ 'Other Parameters' : [],
111
+ 'Attributes' : [],
112
+ 'Methods' : [],
113
+ 'See Also' : [],
114
+ 'Notes' : [],
115
+ 'Warnings' : [],
116
+ 'References' : '' ,
117
+ 'Examples' : '' ,
118
+ 'index' : {}
119
+ }
120
+
100
121
def __init__ (self , docstring , config = {}):
101
122
orig_docstring = docstring
102
123
docstring = textwrap .dedent (docstring ).split ('\n ' )
103
124
104
125
self ._doc = Reader (docstring )
105
- self ._parsed_data = {
106
- 'Signature' : '' ,
107
- 'Summary' : ['' ],
108
- 'Extended Summary' : [],
109
- 'Parameters' : [],
110
- 'Returns' : [],
111
- 'Yields' : [],
112
- 'Raises' : [],
113
- 'Warns' : [],
114
- 'Other Parameters' : [],
115
- 'Attributes' : [],
116
- 'Methods' : [],
117
- 'See Also' : [],
118
- 'Notes' : [],
119
- 'Warnings' : [],
120
- 'References' : '' ,
121
- 'Examples' : '' ,
122
- 'index' : {}
123
- }
126
+ self ._parsed_data = copy .deepcopy (self .sections )
124
127
125
128
try :
126
129
self ._parse ()
You can’t perform that action at this time.
0 commit comments