A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-September/009298.html below:

[Python-Dev] Challenge about print >> None

[Python-Dev] Challenge about print >> None [Python-Dev] Challenge about print >> NoneJeremy Hylton jeremy@beopen.com
Mon, 11 Sep 2000 18:24:13 -0400 (EDT)
>>>>> "GvR" == Guido van Rossum <guido@beopen.com> writes:

  GvR> Don't think of it as

  GvR>   print >>None, args

  GvR> Think of it as

  GvR>   def func(file=None):
  GvR>     print >>file, args

Huh?  Don't you mean think of it as:

def func(file=None):
    if file is None:
       import sys
       print >>sys.stdout, args
    else:
	print >>file, args

At least, I think that's why I find the use of None confusing.  I find
it hard to make a strong association between None and sys.stdout.  In
fact, when I was typing this message, I wrote it as sys.stderr and
only discovered my error upon re-reading the initial message.

Jeremy



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4