> > how about custom constant type?
> > Does python provide?
> No. Python tries to be as "light" as possible. There is a convention
> amongst Python programmers to use upper case names to represent
> constants, e.g. RED = 3.
another aspect of Python numbers that make them "constant" is that all
nu
Please always reply to the list as well as me. Others may be able to
help, and we all learn from our interactions.
Brendan Cheng wrote:
> how about custom constant type?
> Does python provide?
No. Python tries to be as "light" as possible. There is a convention
amongst Python programmers to use
> I wander how to setup the enumeration type
> and constant in Python,
These concepts do not exist in Python per se.
The convention is to make constant names uppercase:
PI = 3.1415926
Enums are a little more variable in implementation depending
on what you want to do with them. If you need
Brendan Cheng wrote:
I wander how to setup the enumeration type and constant in
Python, which I couldn't find the topic in the help file.
There is no built-in enumeration type. See
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/67107
for an example of an enumeration c
Hi,
I wander how to setup the enumeration type and constant in Python, which I couldn't find the topic in the help file.
I'm using python 2.4.3
please give me an example of it as well
Thanks,
Brendan
___
Tutor maillist - Tutor@python.org
Hi,
I wander how to setup the enumeration type and constant in Python, which I couldn't find the topic in the help file.
I'm using python 2.4.3
please give me an example of it as well
Thanks,
Brendan
___
Tutor maillist - Tutor@python.org
h