News for hackers. Stuff that matters.
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!
Re:What’s inside Python ‘for’ loop? by mehrdadn on Monday March 25, 2019 @06:19PM (#19487260)
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.