diff options
author | Alasdair <alnessy@hotmail.com> | 2013-08-28 12:09:30 +0200 |
---|---|---|
committer | Alasdair <alnessy@hotmail.com> | 2013-08-28 12:09:30 +0200 |
commit | 4c101ea2a2305f35264186e072e0f0913d3fa77b (patch) | |
tree | af33aec0f106ba9c3201633feb693e3968506923 | |
parent | 99e579222d823b2d89d6dfb01f7c034fcba39b20 (diff) |
making code clearer
-rwxr-xr-x | wikiquery | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -10,7 +10,10 @@ version = "0.0.2" def display(o): if isinstance(o, list): - print "'%s'" % "', '".join(map(partial(unicode.encode, encoding="utf-8", errors="replace"), o)) + # partially apply the unicode.encode function with appropriate encoding and error handling + encode = partial(unicode.encode, encoding="utf-8", errors="replace") + + print "'%s'" % "', '".join(map(encode, o)) else: print o.encode("utf-8", "replace") |