Take the 2-minute tour × def fib_r(n, memo={0: 0, 1: 1}):
"""recursive fibonacci numbers generation with memoisation
>>> [fib_r(n) for n in range(10)]   >>> fib_r(100)   if n not in
memo:   return memo[n]  The doctest above passes on python 3 but
fails on 2.x like this:  File "euler.py", line 93, in
__main__.fib Failed example:  This is just an example, I have
seen this in several other situations (e.g. whether a unicode
string has an u prefix or not). I was wondering if there is an
option for doctest to ignore trivial differences between python
2 and 3 like this?  I am not looking for a workaround to modify
the test itself so that it works despite the limitation. I just
want to know if there is a flag or something to allow some
lenience for compatibility with these minor things that have
changed in python versions.  share|improve this question Hint:
print(9999999999999999999999999L) outputs without trailing L in
both versions. For more complex situations (like long integers
inside lists etc.) you'd bett