[Python-bugs-list] [Bug #115918] 2.0b2: print a_module.__dict__ also prints the license text

noreply@sourceforge.net noreply@sourceforge.net
Tue, 3 Oct 2000 10:14:50 -0700


Bug #115918, was updated on 2000-Oct-03 07:55
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Summary: 2.0b2: print a_module.__dict__ also prints the license text

Details: When trying to print the dictionary of an imported module, say:

import a_module
print a_module.__dict__

Python 2.0b2 also prints the Python license text (intermingled
with the printing of the dictionary contents).


Follow-Ups:

Date: 2000-Oct-03 08:16
By: gvanrossum

Comment:
Hm. Yes, this is a problem. It's caused because __dict__ contains __builtins__ which contains the magic license object. Barry -- what to do? Maybe the license object should have a static repr which is the entire license text????
-------------------------------------------------------

Date: 2000-Oct-03 08:19
By: jhylton

Comment:
Is there any way to make the license builtin behave nicely in this context?

-------------------------------------------------------

Date: 2000-Oct-03 10:14
By: gvanrossum

Comment:
Fixed by latest checkin to site.py. __repr__ no longer prints and reads; __repr__ is the string you want to see if it's short, and a messages asking you to *call* the object if it needs paging. The printing and reading happens in __call__.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=115918&group_id=5470