Re:What’s inside Python ‘for’ loop?
by kierenj on Monday March 25, 2019 @06:16PM
(#19487242)
What's the overhead of exceptions like in Python? With .NET at least, especially with a debugger attached, this would have a pretty considerable impact!
[ Parent
| on HN ]
Python is already so slow that it's comparable to normal iteration. But here's an example:
timeit('next(x)', 'x = iter(range(1<<30))', number=1<<22) # 0.22
timeit('''try: raise StopIteration()
except StopIteration: pass''', number=1<<22) # 0.78
Re:What’s inside Python ‘for’ loop?
by dijksterhuis on Monday March 25, 2019 @10:20PM
(#19488754)
I pray for the day that Tensorflow has an official rust (or scala) api.