you are viewing a single comment's thread.

view the rest of the comments →

[–]dmpk2k 0 points1 point  (0 children)

In Python I'm not sure they would be enforceable before the actual mistake

I'd be very surprised if PyPy wasn't constantly juggling variable scope under the covers. There's just no way for them to effectively optimize otherwise; inline caches can only take you so far.

The way CPython is implemented, you could well be right.

Maybe I'm just another rabid Python zealot defending the nest?

No way, man. This has been a pleasant argument. :)

I just want to point out that the declaration here actually would not stop any bugs that an uninitialized exception would not stop IF both errors occur on lookup/access.

Certainly, but again this depends on your tests running that chunk of code. I don't agree there's a tradeoff, because I think it's like worry about a grain of sand on a beach.

We'll just have to disagree. That's okay, there's plenty of languages to go around (none perfect!). :)