tomekwojcik / ForgeryPy

An easy to use forged data generator for Python
http://tomekwojcik.github.com/ForgeryPy/
MIT License
67 stars 14 forks source link

added python3 compatibility by catching the errors with xrange #4

Open AlexFrazer opened 10 years ago

AlexFrazer commented 10 years ago

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

pedro-teixeira commented 9 years ago

+1

pilosus commented 8 years ago

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

Narinas commented 5 years ago

yes, it breaks with python3