Python Forum
Best way(s) to organize and use "global" values?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way(s) to organize and use "global" values?
#7
Enum's and their derivatives IntEnum, IntFlag and Flag seem to do quite a lot of what I think I need to do, so I will study them carefully.

Is there any syntactic sugar that would permit the names of Enum's and derivatives to be used WITHOUT prefixing the class name?

I just don't see the logic in having to prefix yet another name in front of a name that I define uniquely in the first place.

E.G., if I have an Enum class of "Colors", why do I have to use Colors.RED instead of just RED?

Basically I'm imagining some syntactic construct similar to the Pascal "with" statement which permits structure field names to be used in a block of code without needing to use the structure name as a prefix for them.

I won't be surprised if there is no such "sugar", but a fellow can wish.

Peter
Reply


Messages In This Thread
RE: Best way(s) to organize and use "global" values? - by pjfarley3 - Sep-03-2020, 12:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I organize my simple ftp modules? blobdx7 3 550 Jan-05-2024, 01:23 PM
Last Post: Gribouillis
  How can I organize my code according to output that I want ilknurg 1 1,191 Mar-11-2022, 09:24 AM
Last Post: perfringo
Star Split and organize my Pandas Dataframe brunolelli 4 2,740 Apr-18-2021, 03:00 AM
Last Post: brunolelli
  Counting number of words and organize for the bigger frequencies to the small ones. valeriorsneto 1 1,691 Feb-05-2021, 03:49 PM
Last Post: perfringo
  Global variable does not seem to be global. Columbo 6 3,730 Jul-15-2019, 11:00 PM
Last Post: Columbo

Forum Jump:

User Panel Messages

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