Skip to content

Commit bbf5052

Browse files
authored
Merge pull request #85 from Chilipp/dict
remove OrderedDict
2 parents e06ce19 + 12a335c commit bbf5052

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

autodocsumm/__init__.py

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ def force_decode(string: str, encoding: str) -> str:
7878
return string
7979

8080

81-
try:
82-
from cyordereddict import OrderedDict
83-
except ImportError:
84-
try:
85-
from collections import OrderedDict
86-
except ImportError:
87-
from ordereddict import OrderedDict
88-
8981
from . import _version
9082
__version__ = _version.get_versions()['version']
9183

@@ -262,7 +254,7 @@ def get_grouped_documenters(self, all_members=False):
262254
except AttributeError: # sphinx<3.0
263255
pass
264256

265-
documenters = OrderedDict()
257+
documenters = {}
266258
for e in memberdocumenters:
267259
section = self.member_sections.get(
268260
e[0].member_order, 'Miscellaneous')
@@ -350,13 +342,13 @@ class AutoSummModuleDocumenter(ModuleDocumenter, AutosummaryDocumenter):
350342
option_spec['autosummary-' + _option] = option_spec[_option]
351343
del _option
352344

353-
member_sections = OrderedDict([
354-
(ad.ClassDocumenter.member_order, 'Classes'),
355-
(ad.ExceptionDocumenter.member_order, 'Exceptions'),
356-
(ad.FunctionDocumenter.member_order, 'Functions'),
357-
(ad.DataDocumenter.member_order, 'Data'),
358-
])
359-
""":class:`~collections.OrderedDict` that includes the autosummary sections
345+
member_sections = {
346+
ad.ClassDocumenter.member_order: 'Classes',
347+
ad.ExceptionDocumenter.member_order: 'Exceptions',
348+
ad.FunctionDocumenter.member_order: 'Functions',
349+
ad.DataDocumenter.member_order: 'Data',
350+
}
351+
""":class:`dict` that includes the autosummary sections
360352
361353
This dictionary defines the sections for the autosummmary option. The
362354
values correspond to the :attr:`sphinx.ext.autodoc.Documenter.member_order`
@@ -400,12 +392,12 @@ class AutoSummClassDocumenter(ClassDocumenter, AutosummaryDocumenter):
400392
option_spec['autosummary-' + _option] = option_spec[_option]
401393
del _option
402394

403-
member_sections = OrderedDict([
404-
(ad.ClassDocumenter.member_order, 'Classes'),
405-
(ad.MethodDocumenter.member_order, 'Methods'),
406-
(ad.AttributeDocumenter.member_order, 'Attributes'),
407-
])
408-
""":class:`~collections.OrderedDict` that includes the autosummary sections
395+
member_sections = {
396+
ad.ClassDocumenter.member_order: 'Classes',
397+
ad.MethodDocumenter.member_order: 'Methods',
398+
ad.AttributeDocumenter.member_order: 'Attributes',
399+
}
400+
""":class:`dict` that includes the autosummary sections
409401
410402
This dictionary defines the sections for the autosummmary option. The
411403
values correspond to the :attr:`sphinx.ext.autodoc.Documenter.member_order`

0 commit comments

Comments
 (0)