|
|
|
|
|
by riazrizvi
2134 days ago
|
|
Curly braces designate scope in C like languages: int i = 100;
std::cout << i << std::endl;
if (1) {
int i = 200;
std::cout << i << std::endl;
}
std::cout << i << std::endl;
giving 100
200
100
They don't seem to serve such a purpose in Pytov. Eyeballing the source, it looks like you'd get this: i = 100
print (i)
if (True) {
i = 200
print (i)
}
print (i)
giving 100
200
200
So what's the point? |
|
Yes, you would - variables in Python have function-scope, not block-scope.
It doesn’t look like this project changes anything about Python except trivial bits of syntax.