News for hackers. Stuff that matters.
Re:Static types in Python by Ph0X on Thursday October 13, 2016 @09:19PM (#12705554)
Well in the pypy case, couldn't this just be a toggle? As in, you as the user guarantee that your type annotations are correct and strict, and if it isn't, then pypy will just blow up in your face when type annotations aren't respected.

I think that's a fair trade off, and easily doable. Those who want it and respect it get the speedup, those who don't don't lose anything.

Re:Static types in Python by haimez on Friday October 14, 2016 @01:17AM (#12706253)
I assure you, it's not that simple. You either check types at runtime (big performance penalty, aka: C Python) or you don't because a compiler (or JIT) did the leg work.

If you have to double check types at runtime, you've already lost.

Re:Static types in Python by Ph0X on Monday October 17, 2016 @03:41AM (#12723264)
But that's why I say, there should be a pypy flag where you tell it to not double check at run time and that you've made sure your annotation is correct.

Now if it isn't correct, you'll probably get a segfault or some nasty error and it'll blow up.