ForgeryPy icon indicating copy to clipboard operation
ForgeryPy copied to clipboard

added python3 compatibility by catching the errors with xrange

Open AlexFrazer opened this issue 11 years ago • 3 comments

https://github.com/tomekwojcik/ForgeryPy/issues/3

AlexFrazer avatar Aug 05 '14 14:08 AlexFrazer

+1

pedro-teixeira avatar Feb 05 '15 14:02 pedro-teixeira

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

pilosus avatar Nov 06 '16 09:11 pilosus

yes, it breaks with python3

Narinas avatar May 10 '19 21:05 Narinas