Skip to content

Commit bc25bb2

Browse files
committed
pprint supports frozendict
1 parent 3a07c46 commit bc25bb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/pprint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ def _pprint_dataclass(self, object, stream, indent, allowance, context, level):
221221
def _pprint_dict(self, object, stream, indent, allowance, context, level):
222222
write = stream.write
223223
typ = object.__class__
224-
if typ is dict:
225-
write('{')
226-
end = '}'
227-
else:
224+
if typ is frozendict:
228225
stream.write(typ.__name__ + '({')
229226
end = '})'
230227
indent += len(typ.__name__) + 1
228+
else:
229+
write('{')
230+
end = '}'
231231
if self._indent_per_level > 1:
232232
write((self._indent_per_level - 1) * ' ')
233233
length = len(object)

0 commit comments

Comments
 (0)