Steven D'Aprano wrote:
> Yes, that would be how I interpret constants: You want a name which can't
> be re-bound to something else.
>
> One work-around is to use the convention of writing the name in all caps:
>
> CONSTANT = some_value
>
> and then trust that your module user doesn't rebind CONSTA
On Sun, 20 Nov 2005 08:56:33 +1100, Ben Finney wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>> On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
>> > Is there any difference between a Python immutable value, and a
>> > constant? I suppose "constant" also implies that the *name* binds
>>
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
> > Is there any difference between a Python immutable value, and a
> > constant? I suppose "constant" also implies that the *name* binds
> > unchangeably to a particular value. Is that meaningful?
>
On Sat, 19 Nov 2005 21:45:40 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
>
>> Is there any difference between a Python immutable value, and a
>> constant? I suppose "constant" also implies that the *name* binds
>> unchangeably to a parti
On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
> Is there any difference between a Python immutable value, and a
> constant? I suppose "constant" also implies that the *name* binds
> unchangeably to a particular value. Is that meaningful?
That's precisely how I understand "constant" to be
On Fri, 18 Nov 2005 23:43:10 +1100 (EST), Ben Finney <[EMAIL PROTECTED]> wrote:
>Bengt Richter <[EMAIL PROTECTED]> wrote:
>> Ben Finney <[EMAIL PROTECTED]> wrote:
>> >I've recently packaged 'enum' in PyPI.
>> [...]
>> My notion of enum comes from (what I remember of) Pascal
>
>You might want to in
Bengt Richter <[EMAIL PROTECTED]> wrote:
> Ben Finney <[EMAIL PROTECTED]> wrote:
> >I've recently packaged 'enum' in PyPI.
> [...]
> My notion of enum comes from (what I remember of) Pascal
You might want to investigate the 'enum' package for my idea of how an
enumerated type can work.
> which is
On Fri, 18 Nov 2005 14:32:46 +1100 (EST), Ben Finney <[EMAIL PROTECTED]> wrote:
>Howdy all,
>
>I've recently packaged 'enum' in PyPI. In its description, I make the
>claim that it creates "immutable" enumeration objects, and that the
>enumeration values are "constant" values.
>
>This raises questi