Python Forum
what is the point in function access to globals being read-only?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what is the point in function access to globals being read-only?
#3
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.
Reply


Messages In This Thread
RE: what is the point in function access to globals being read-only? - by Skaperen - Sep-26-2019, 01:36 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020