Re: UTF-8 characters in doctest

2007-09-22 Thread John J. Lee
Peter Otten <[EMAIL PROTECTED]> writes: [...] >> Forgive me if this is a stupid question, but: What purpose does >> function f serve? > > Like the OP's get_inventary_number() it takes a unicode string and > returns a tuple of unicode strings. I'ts pointless otherwise. I hoped I > had stripped down

Re: UTF-8 characters in doctest

2007-09-20 Thread Peter Otten
John J. Lee wrote: > Peter Otten <[EMAIL PROTECTED]> writes: > [...] >> # -*- coding: utf8 -*- >> r""" > f("äöü".decode("utf8")) >> (u'\xe4\xf6\xfc',) >> """ >> def f(s): >> return (s,) > > Forgive me if this is a stupid question, but: What purpose does > function f serve? Like the OP's

Re: UTF-8 characters in doctest

2007-09-20 Thread J. Cliff Dyer
J. Cliff Dyer wrote: > John J. Lee wrote: > >> Peter Otten <[EMAIL PROTECTED]> writes: >> [...] >> >> >>> def f(s): >>> return (s,) >>> >>> >> Forgive me if this is a stupid question, but: What purpose does >> function f serve? >> >> >> John >> >> > > Well, it has

Re: UTF-8 characters in doctest

2007-09-20 Thread J. Cliff Dyer
John J. Lee wrote: > Peter Otten <[EMAIL PROTECTED]> writes: > [...] > >> def f(s): >> return (s,) >> > > Forgive me if this is a stupid question, but: What purpose does > function f serve? > > > John > Well, it has nothing to do with the unicode bit that came before it. It just ta

Re: UTF-8 characters in doctest

2007-09-20 Thread John J. Lee
Peter Otten <[EMAIL PROTECTED]> writes: [...] > # -*- coding: utf8 -*- > r""" f("äöü".decode("utf8")) > (u'\xe4\xf6\xfc',) > """ > def f(s): > return (s,) Forgive me if this is a stupid question, but: What purpose does function f serve? John -- http://mail.python.org/mailman/listinfo/p

Re: UTF-8 characters in doctest

2007-09-19 Thread Peter Otten
Bzyczek wrote: > So my question is: Is it possible to run doctests with UTF-8 > characters? And if your answer will be YES, tell me please how... Use raw strings in combination with explicit decoding and a little try-and-error. E. g. this little gem passes ;) # -*- coding: utf8 -*- r""" >>> f("ä