1# -*- coding: latin-1 -*- 2 3__doc__ = (u""" 4>>> a == 'abc' 5True 6>>> isinstance(a, str) 7True 8 9>>> isinstance(s, str) 10True 11>>> len(s) 126 13>>> s == 'a����o' 14True 15 16>>> isinstance(add(), str) 17True 18>>> len(add()) 199 20>>> add() == 'abca����o' 21True 22 23>>> isinstance(add_literal(), str) 24True 25>>> len(add_literal()) 269 27>>> add_literal() == 'abca����o' 28True 29 30>>> isinstance(typed(), str) 31True 32>>> len(typed()) 336 34>>> typed() == '������' 35True 36 37""" 38# recoding/escaping is required to properly pass the literals to doctest 39).encode('unicode_escape').decode('ASCII').replace(u'\\n', u'\n') 40 41a = 'abc' 42s = 'a����o' 43u = u'a����o' 44 45cdef str S = '������' 46 47def add(): 48 return a+s 49 50def add_literal(): 51 return 'abc' + 'a����o' 52 53def typed(): 54 return S 55