You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because pprint_thing checks isinstance(thing, dict), it also catches objects that inherit from dict and forces them to print in the {'a':1, ... } format regardless of the object's unicode, str, or repr definitions. On my machine, I've changed the _pprint_dict function to just:
return unicode(seq)
which seems to give the behavior I'm looking for. I see pprint_thing warns against unicode(object) in general due to nested sequences, but since _pprint_dict doesn't do anything with _nest_lvl anyway, I figured it was probably safe.
The text was updated successfully, but these errors were encountered:
Because pprint_thing checks isinstance(thing, dict), it also catches objects that inherit from dict and forces them to print in the {'a':1, ... } format regardless of the object's unicode, str, or repr definitions. On my machine, I've changed the _pprint_dict function to just:
which seems to give the behavior I'm looking for. I see pprint_thing warns against unicode(object) in general due to nested sequences, but since _pprint_dict doesn't do anything with _nest_lvl anyway, I figured it was probably safe.
The text was updated successfully, but these errors were encountered: