Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python 3 sucks

Name: Anonymous 2009-01-12 14:10

The third version of FIOC ( Python3000 for you cheese lovers ) is kind of lame, even lamer than classic FIOC. Minor changes suck and bigger ones weren't necessary.

Name: Anonymous 2010-04-20 11:03

>>55
Actually, you are right. It can be done quite easily from the top level. However, inside that inner function I would have expected it to reference the 'x' in the global scope and not in the outside functions scope, which had been modified. My issue is that pythons scope is either not static, or it does an implicit letrec*.

And you still haven't told me why this is a good thing ;)

Name: >>56 2010-04-20 11:05

>>55
I'm not sure where you were going with that example, the local variable that is referenced before assignment is in fact the second one.
>>> x = 10
>>> def f():
...  print x
...
>>> f()
10
>>> def f():
...  print x
...  x = 20
...
>>> f()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in f
UnboundLocalError: local variable 'x' referenced before assignment
>>>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List