ForgeryPy
ForgeryPy copied to clipboard
added python3 compatibility by catching the errors with xrange
https://github.com/tomekwojcik/ForgeryPy/issues/3
+1
Yes, please, merge that commit. Otherwise we have broken methods with xrange that don't work for python3. Even for python2 such a small range has a negligible performance advantage when you compare xrange with range:
$ python -m timeit -n 1000000 "import ip; ip.get_random_ip_v4_xrange()" 1000000 loops, best of 3: 7.86 usec per loop
$ python -m timeit -n 1000000 "import ip; ip.get_random_ip_v4_range()" 1000000 loops, best of 3: 8.09 usec per loop
yes, it breaks with python3