File tree Expand file tree Collapse file tree 1 file changed +22
-19
lines changed Expand file tree Collapse file tree 1 file changed +22
-19
lines changed Original file line number Diff line number Diff line change 99import pydoc
1010from warnings import warn
1111import collections
12+ import copy
1213import sys
1314
1415
@@ -97,30 +98,32 @@ def __str__(self):
9798
9899
99100class 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+
100121 def __init__ (self , docstring , config = {}):
101122 orig_docstring = docstring
102123 docstring = textwrap .dedent (docstring ).split ('\n ' )
103124
104125 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 )
124127
125128 try :
126129 self ._parse ()
You can’t perform that action at this time.
0 commit comments