r/programming • • Apr 10 '08

Is python a good first language?

[deleted] — view deleted post

21 Upvotes

79 comments sorted by

View all comments

Show parent comment

1

u/commonslip Apr 12 '08

I really prefer that this not need a keyword at all. I know lexical scope takes a second to get used to the first time you see it but it really is "the right behavior" and I don't see why Python just doesn't support it.

Maybe backwards compatibility?

2

u/jbellis Apr 12 '08

python is lexically scoped; you just can't re-bind variables from a different scope without the keyword. in the first lexically scoped versions of Python (2.0-2.1?) you could, but guido had it taken out because he felt that the potential confusion outweighed the benefits.

in current python versions you either have to use a global or a container object as a workaround. which is gross and I wish guido hadn't done that, but on the whole python is still better than the alternatives. :)