diff options
author | Mike Bayer <classic@zzzcomputing.com> | 2015-01-07 12:57:40 -0500 |
---|---|---|
committer | Mike Bayer <classic@zzzcomputing.com> | 2015-01-07 12:57:40 -0500 |
commit | 7c27859b69316c18e7ffef2cd5fd38497db01c44 (patch) | |
tree | db08bd9125b71b3d464c17dccfa4739baad3b570 | |
parent | cbe8b1ce0a3fbd5668051ba70f00cb0de3d095dd (diff) | |
parent | 3499108012dd84144926d930ab58b5e3b5f296e9 (diff) | |
download | mako-7c27859b69316c18e7ffef2cd5fd38497db01c44.tar.gz |
Merged in thorade/mako-2/thorade/unicoderst-edited-online-with-bitbucket--1420641728556 (pull request #15)
unicode.rst edited online with Bitbucket,
-rw-r--r-- | doc/build/unicode.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/build/unicode.rst b/doc/build/unicode.rst index 16eb161..1ba364e 100644 --- a/doc/build/unicode.rst +++ b/doc/build/unicode.rst @@ -229,7 +229,7 @@ supported codec: mylookup = TemplateLookup(directories=['/docs'], output_encoding='utf-8', encoding_errors='replace') mytemplate = mylookup.get_template("foo.txt") - print mytemplate.render() + print(mytemplate.render()) :meth:`~.Template.render` will return a ``bytes`` object in Python 3 if an output encoding is specified. By default it performs no encoding and @@ -240,14 +240,14 @@ returns a native string. .. sourcecode:: python - print mytemplate.render_unicode() + print(mytemplate.render_unicode()) The above method disgards the output encoding keyword argument; you can encode yourself by saying: .. sourcecode:: python - print mytemplate.render_unicode().encode('utf-8', 'replace') + print(mytemplate.render_unicode().encode('utf-8', 'replace')) Buffer Selection ---------------- @@ -289,7 +289,7 @@ Python. For these users, assuming they're sticking with Python from mako.template import Template t = Template("drôle de petite voix m’a réveillé.", disable_unicode=True, input_encoding='utf-8') - print t.code + print(t.code) The ``disable_unicode`` mode is strictly a Python 2 thing. It is not supported at all in Python 3. |