What a weird thing !!?

Grant Edwards grant at nowhere.
Mon Feb 21 12:16:53 EST 2000


In article <NQvr4.357$mYj.186977280 at newsa.telia.net>, Fredrik Lundh wrote:
>Florent RamiŠre <framiere at netcom-service.com> wrote:
>>    well, i thinked about this method, it can be suitable for my project,
>>     but in one only way: it has to be set one time for all ...
>
>you still haven't explained why you're totally uncapable
>of changing "print x" to e.g. "pr(x)" in your project, but
>alright:
>
>import sys
>
>class florentStdout:
>    def write(self, str):
>        sys.__stdout__.write(str)
>    def __setattr__(self, attr, value):
>        pass
>    def __getattr__(self, attr):
>        return 0
>
># use non-standard print semantics
>sys.stdout = florentStdout()
>
>print "a",
>print "b"

I can't say exactly when or why, but my gut feeling is that
should you take this path, you'll regret it.  Or, more likely,
somebody else who ends up with your code will regret it.

-- 
Grant Edwards                   grante             Yow!  You should all JUMP
                                  at               UP AND DOWN for TWO HOURS
                               visi.com            while I decide on a NEW
                                                   CAREER!!



More information about the Python-list mailing list