[Pythonmac-SIG] Newbie: Unicode in Python 2.3?

Nicholas Riley njriley at uiuc.edu
Sat Mar 20 15:12:47 EST 2004


On Sat, Mar 20, 2004 at 08:51:33PM +0100, Philippe de Rochambeau wrote:
> One more question: why 'sys.stdout' in parentheses? 

Because the result of codecs.getwriter('utf8') is a class, and you're
instantiating the class with 'sys.stdout' as a parameter to __init__.

Also, it doesn't work very well otherwise :)

>>> codecs.getwriter('utf8') sys.stdout
  File "<stdin>", line 1
    codecs.getwriter('utf8') sys.stdout
                               ^
SyntaxError: invalid syntax

-- 
=Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>



More information about the Pythonmac-SIG mailing list