GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — marking lines that only run in py3.5 · benthomasson/deepdiff@1c5e4cc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • deepdiff
    • helper.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deepdiff/helper.py‎

Copy file name to clipboardExpand all lines: deepdiff/helper.py
+12-8Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,27 @@ class np_type:
9090

9191

9292
class OrderedDictPlus(OrderedDict):
93+
"""
94+
This class is only used when a python version is used where
95+
the built-in dictionary is not ordered.
96+
"""
9397

94-
def __repr__(self):
95-
return str(dict(self))
98+
def __repr__(self): # pragma: no cover. Only used in pypy3 and py3.5
99+
return str(dict(self)) # pragma: no cover. Only used in pypy3 and py3.5
96100

97101
__str__ = __repr__
98102

99-
def copy(self):
100-
result = OrderedDictPlus()
101-
for k, v in self.items():
102-
result[k] = v
103-
return result
103+
def copy(self): # pragma: no cover. Only used in pypy3 and py3.5
104+
result = OrderedDictPlus() # pragma: no cover. Only used in pypy3 and py3.5
105+
for k, v in self.items(): # pragma: no cover. Only used in pypy3 and py3.5
106+
result[k] = v # pragma: no cover. Only used in pypy3 and py3.5
107+
return result # pragma: no cover. Only used in pypy3 and py3.5
104108

105109

106110
if DICT_IS_SORTED:
107111
dict_ = dict
108112
else:
109-
dict_ = OrderedDictPlus
113+
dict_ = OrderedDictPlus # pragma: no cover. Only used in pypy3 and py3.5
110114

111115

112116
if py4:

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.