Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
doctests compatibility for python 2 & python 3
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Steven D'Aprano, post: 5138295"] Alas, I think you've run into one of the weaknesses of doctest. Don't get me wrong, I am a huge fan of doctest, but it is hard to write polyglot string tests with it, as you have discovered. However, you may be able to get 95% of the way by using print. def func(a): """aaa """ return a ought to behave identically in both Python 2 and Python 3.3, provided you only print one object at a time. This ought to work with both ASCII and non-ASCII (at least in the BMP). [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
doctests compatibility for python 2 & python 3
Top