Re: Funny behaviour with __future__ and doctest between 2.6 and 3.1

2010-01-30 Thread Mattsteel
On 29 Gen, 17:30, Peter Otten <__pete...@web.de> wrote: > I think you can work around the problem. The following should pass in Python > 2.6 and 3.1: > > '''>>> concat('hello','world') == 'hello world' > True > ''' I see. Thank for the concern. M. -- http://mail.python.org/mailman/listinfo/python

Re: Funny behaviour with __future__ and doctest between 2.6 and 3.1

2010-01-29 Thread Peter Otten
Mattsteel wrote: > Sadly (for me), you're right... then the only way to use doctest to > work both in 2.6 and 3.1 (without modifications between them) is > something like this: > > #!/usr/bin/env python > ''' str(concat('hello','world')) > 'hello world' > ''' > from __future__ import unicod

Re: Funny behaviour with __future__ and doctest between 2.6 and 3.1

2010-01-29 Thread Mattsteel
Hi Peter. Sadly (for me), you're right... then the only way to use doctest to work both in 2.6 and 3.1 (without modifications between them) is something like this: #!/usr/bin/env python ''' >>> str(concat('hello','world')) 'hello world' ''' from __future__ import unicode_literals def concat( firs

Re: Funny behaviour with __future__ and doctest between 2.6 and 3.1

2010-01-29 Thread Peter Otten
Mattsteel wrote: > Hello all. > I'm using Python 2.6.4 and Python 3.1.1. > My wish is to code in a 3.1-compliant way using 2.6, so I'm importing > the __future__ module. > I've found a funny thing comparing the two folliwing snippets that > differ for one line only, that is the position of __futur