This must be an Easter Egg someone left in Publish.py. In Publish.get_module_info I see # Reset response handling of tracebacks, if necessary: if debug_mode or not hide_tracebacks: def hack_response(): import Response Response._tbopen = '<PRE>' Response._tbclose = '</PRE>' hack_response() Why go to the trouble of defining a function and calling it just to modify Response._tbopen/_tbclose? Can't they just be set directly? Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/ skip@mojam.com | Musi-Cal: http://www.musi-cal.com/ 518-372-5583
i could be wrong here, but this looks like a "traditional" python-ism to defer importing of the module Response until it's needed. ----- Original Message ----- From: <skip@mojam.com> Sent: Thursday, April 15, 1999 1:58 PM
Why go to the trouble of defining a function and calling it just to modify Response._tbopen/_tbclose? Can't they just be set directly?
participants (2)
-
skip@mojam.com -
Wolf Logan