Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97456

Re: Python 2 ‘print’, coercing arguments to Unicode

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Python 2 ‘print’, coercing arguments to Unicode
Date 2015-10-07 08:23 +1100
References <851td81g08.fsf@benfinney.id.au> <85wpv0z368.fsf@benfinney.id.au> <201510061248.t96CmCWP011700@fido.openend.se>
Newsgroups comp.lang.python
Message-ID <mailman.434.1444166612.28679.python-list@python.org> (permalink)

Show all headers | View raw


Laura Creighton <lac@openend.se> writes:

> Hmm, now that I read the six document again
>  @six.python_2_unicode_compatible


Peter Otten <__peter__@web.de> writes:

> I don't think this is possible with the print statement, but the
> print() function can be replaced with anything you like:


Hmm. I am more looking for something that doesn't involve replacing
‘print’, but rather to hook into whatever it uses to coerce the type of
its arguments.

-- 
 \        “The problem with television is that the people must sit and |
  `\    keep their eyes glued on a screen: the average American family |
_o__)                 hasn't time for it.” —_The New York Times_, 1939 |
Ben Finney

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python 2 ‘print’, coercing arguments to Unicode Ben Finney <ben+python@benfinney.id.au> - 2015-10-07 08:23 +1100

csiph-web