Posts: 4,550
Threads: 1,458
Joined: Sep 2016
what is the point in function access to globals being read-only? referencing objects lets you modify them without the need for a global statement. is there some specific advantage to this?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,550
Threads: 1,458
Joined: Sep 2016
if the global variable exists, already, a read access gets that value instead of its default if not found. for assigning, it does not do the same. i'm wondering about the reasoning for that, since it could do the same. it's just that the default is different. most other languages don't have globals at all, so it's hard to find a comparison. most use some kind of class or function thing to do that. maybe this is why it is considered to be unpythonic to use globals?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.