pprint.isrecursive: is it ever recursive? (a bug?)
Roman Suzi
rnd at onego.ru
Sun May 13 15:35:38 EDT 2001
Hello!
I was looking at pprint code and out of curiosity tried
to repr self-referencing list:
>>> import pprint
>>> l=[1,2]
>>> l[0]=l
>>> pprint.isreadable(l)
0
>>> pprint.isrecursive(l)
0
>>> l
[[...], 2]
>>> pprint.saferepr(l)
'[<Recursion on list with id=135078960>, 2]'
>>>
However, it seems to me that isrecursive(l) must be 1, not 0.
Or do I misunderstand it's meaning?
Sincerely yours, Roman Suzi
--
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Sunday, May 13, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "Ethernet n.: something used to catch the etherbunny." _/
More information about the Python-list
mailing list