[issue1440] Checks for PySys_GetObject("std???") == Py_None

Guido van Rossum report at bugs.python.org
Wed Nov 14 19:54:57 CET 2007


Guido van Rossum added the comment:

Go for it.

On Nov 14, 2007 10:39 AM, Christian Heimes <report at bugs.python.org> wrote:
>
> Christian Heimes added the comment:
>
> Guido van Rossum wrote:
> > The patch looks okay, but I just thought of something -- why not make
> > sys.stdout and friends be undefined (i.e. NULL) instead of setting them
> > to None?  That way this patch isn't necessary and you only need one
> > small change to builtin_print() -- which you need anyway (Try deleting
> > sys.stdout and then printing something.)
>
> I prefer "if sys.stdout is None" over "if hasattr(sys, 'stdout'):" and
> "sys.stdout = None" over "del sys.stdout". I can't put words to it but
> it feels more natural to set the stream to None (NULL) than to
> incinerate the stream.
>
> IMO the problem warrants a short poll at Python 3000 dev.
>
> Christian
>
>
> __________________________________
> Tracker <report at bugs.python.org>
> <http://bugs.python.org/issue1440>
> __________________________________
>

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1440>
__________________________________


More information about the Python-bugs-list mailing list