]> granicus.if.org Git - python/commitdiff
Add example
authorAndrew M. Kuchling <amk@amk.ca>
Sun, 13 Apr 2008 22:39:12 +0000 (22:39 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sun, 13 Apr 2008 22:39:12 +0000 (22:39 +0000)
Doc/whatsnew/2.6.rst

index b10c48d474669a1afe76a86e1640cd8e05af1e08..ea330bb9639b47b8f5fd76f32749e6213a75cfe9 100644 (file)
@@ -736,7 +736,13 @@ There's also a ``__future__`` import that causes all string literals
 to become Unicode strings.  This means that ``\u`` escape sequences 
 can be used to include Unicode characters.
 
-XXX give example
+    from __future__ import unicode_literals
+
+    s = ('\u751f\u3080\u304e\u3000\u751f\u3054'
+         '\u3081\u3000\u751f\u305f\u307e\u3054')
+
+    print len(s)               # 12 Unicode characters
+
 
 .. seealso::