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
PrettyPrinter version: 3.10? couldn't find anything more specific
Python version: 3.10.8
Operating System: Gentoo
Description
pretty printer truncates data
# dict with PrettyPrinter:
{ 0: defaultdict(<function <lambda> at 0x7fcf56d5c940>,
{ U: defaultdict(<function <lambda> at 0x7fcf56d5c940>,
{ K: defaultdict(<function <lambda> at 0x7fcf56d5c940>,
{ None: defaultdict(<function <lambda> at 0x7fcf56d5c940>,
{
# there clearly is some data missing!
# DICT with print():
{0: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {U: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {K: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {None: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {'UNKN_V': defaultdict(<function <lambda> at 0x7fe9c7c04940>, {}), V0: datetime.datetime(2022, 11, 10, 18, 31, 9, 743503), V1: datetime.datetime(2022, 11, 10, 18, 31, 9, 743503)}), V0: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {'UNKN_V': defaultdict(<function <lambda> at 0x7fe9c7c04940>, {V0: 'now I know V'})}), V1: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {'UNKN_V': defaultdict(<function <lambda> at 0x7fe9c7c04940>, {V1: 'now I know V'})})})})})}
# manually formatted:
{ 0: defaultdict(<function <lambda> at 0x7fe9c7c04940>,
{ U: defaultdict(<function <lambda> at 0x7fe9c7c04940>, { K: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {
None: defaultdict(<function <lambda> at 0x7fe9c7c04940>,
{
'UNKN_V': defaultdict(<function <lambda> at 0x7fe9c7c04940>, {}),
V0: datetime.datetime(2022, 11, 10, 18, 31, 9, 743503), V1: datetime.datetime(2022, 11, 10, 18, 31, 9, 743503) }), V0: defaultdict(<function <lambda> at 0x7fe9c7c04940>, {
'UNKN_V': defaultdict(<function <lambda> at 0x7fe9c7c04940>,
{
V0: 'now I know V'
})
}),
V1: defaultdict(<function <lambda> at 0x7fe9c7c04940>,
{
'UNKN_V': defaultdict(<function <lambda> at 0x7fe9c7c04940>,
{
V1: 'now I know V'
})
})
})
})
})
}
What I Did
frompprintimportPrettyPrinterpprint=PrettyPrinter(indent=4).pprint# also tried with other values for 'indent'fromcollectionsimportdefaultdictdd=lambda: defaultdict(dd)
ncache= {0: dd()}
ncache[0]['U']['K']['V0']['UNKN_V']['V0'] ='now I know V'ncache[0]['U']['K']['V1']['UNKN_V']['V1'] ='now I know V'pprint(ncache)
print(ncache)
The text was updated successfully, but these errors were encountered:
Description
pretty printer truncates data
What I Did
The text was updated successfully, but these errors were encountered: