Re: Enum class with ToString functionality

2007-09-12 Thread Neil Cerutti
On 2007-09-11, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Perhaps Ben should have followed the usual practice of > commercial, closed- source software developers and started > counting his version numbers at one instead of zero, miss a few > releases, use randomly large increments occasionally, a

Re: Enum class with ToString functionality

2007-09-11 Thread Steven D'Aprano
On Mon, 10 Sep 2007 18:03:11 -0700, TheFlyingDutchman wrote: >> I'd like to know if the Cheeseshop package 'enum' is useful to you. Any >> constructive feedback would be appreciated. >> >> http://cheeseshop.python.org/pypi/enum/> > > Looking at the documentation it looks excellent. But I don'

Re: Enum class with ToString functionality

2007-09-11 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASSED: > testResultAsStrin

Re: Enum class with ToString functionality

2007-09-11 Thread J. Cliff Dyer
Zara wrote: > On Mon, 10 Sep 2007 02:28:57 -0700, [EMAIL PROTECTED] wrote: > > >> Hi, >> >> I have the following class - >> >> class TestOutcomes: >>PASSED = 0 >>FAILED = 1 >>ABORTED = 2 >> >> plus the following code - >> >> testResult = TestOutcomes.PASSED >> >> testResultAsString >

Version numbering (was: Enum class with ToString functionality)

2007-09-10 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > On Sep 10, 7:55 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > Uh... The 1.0 version is vaporware? > > I think not. 42% of it is alive and kicking as we speak. That's odd. Do you think some similar matchematical relationship exists between Pyth

Re: Enum class with ToString functionality

2007-09-10 Thread Zara
On Mon, 10 Sep 2007 02:28:57 -0700, [EMAIL PROTECTED] wrote: >Hi, > >I have the following class - > >class TestOutcomes: >PASSED = 0 >FAILED = 1 >ABORTED = 2 > >plus the following code - > >testResult = TestOutcomes.PASSED > >testResultAsString >if testResult == TestOutcomes.PASSED: >

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 7:55 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > >> TheFlyingDutchman <[EMAIL PROTECTED]> writes: > http://cheeseshop.python.org/pypi/enum/> > >> (Please preserve attribution lines so

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 8:02 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > > Looking at the documentation it looks excellent. But I don't > > >

Re: Enum class with ToString functionality

2007-09-10 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > Looking at the documentation it looks excellent. But I don't > > > understand the 0.4.2 version number, > > > > Note the tag that says

Re: Enum class with ToString functionality

2007-09-10 Thread J. Cliff Dyer
TheFlyingDutchman wrote: > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: >> TheFlyingDutchman <[EMAIL PROTECTED]> writes: http://cheeseshop.python.org/pypi/enum/> >> (Please preserve attribution lines so it's clear who wrote what.) >> >> >>> Looking at the documentation it look

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > http://cheeseshop.python.org/pypi/enum/> > > (Please preserve attribution lines so it's clear who wrote what.) > > > Looking at the documentation it looks excellent. But I don't > > u

Re: Enum class with ToString functionality

2007-09-10 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > http://cheeseshop.python.org/pypi/enum/> (Please preserve attribution lines so it's clear who wrote what.) > Looking at the documentation it looks excellent. But I don't > understand the 0.4.2 version number, Note the tag that says the "Deve

Re: Enum class with ToString functionality

2007-09-10 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : > On Sep 8, 9:52 am, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >>TheFlyingDutchman a écrit : (snip) >>>class TestOutcomes: >>>PASSED = 0 >>>FAILED = 1 >>>ABORTED = 2 >> >>>def ToString(outcome): >>>if outcome == TestOutcomes.PASSED: >>>

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
> > I'd like to know if the Cheeseshop package 'enum' is useful to > you. Any constructive feedback would be appreciated. > > http://cheeseshop.python.org/pypi/enum/> Looking at the documentation it looks excellent. But I don't understand the 0.4.2 version number, particularly when you refer

Re: Enum class with ToString functionality

2007-09-10 Thread Ben Finney
[EMAIL PROTECTED] writes: > But it would be much nicer if I had a function to covert to string > as part of the TestOutcomes class. How would I implement this? Others have given ad hoc implementations that may do what you want. I'd like to know if the Cheeseshop package 'enum' is useful to you.

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 8, 9:52 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman a écrit : > > > > > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > > >>Hi, > > >>I have the following class - > > >>class TestOutcomes: > >>PASSED = 0 > >>FAILED = 1 > >>ABORTED = 2 > > >>plus the foll

Re: Enum class with ToString functionality

2007-09-10 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > >>Hi, >> >>I have the following class - >> >>class TestOutcomes: >>PASSED = 0 >>FAILED = 1 >>ABORTED = 2 >> >>plus the following code - >> >>testResult = TestOutcomes.PASSED >> >>testResultAsString >>if testR

Re: Enum class with ToString functionality

2007-09-10 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASSED: > testResultAsString = "Pas

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASSED: > te

Re: Enum class with ToString functionality

2007-09-10 Thread David
On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASS

Re: Enum class with ToString functionality

2007-09-10 Thread aine_canby
On 10 Sep, 13:35, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > > I have the following class - > > > class TestOutcomes: > > PASSED = 0 > > FAILED = 1 > > ABORTED = 2 > > > plus the following code - > > > testResult = T

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASSED: > te

Re: Enum class with ToString functionality

2007-09-10 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > But it would be much nicer if I had a function to covert to string as > part of the TestOutcomes class. How would I implement this? Perhaps: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486 -- http://mail.python.org/mailman/listinfo/python-list

Enum class with ToString functionality

2007-09-10 Thread bg_ie
Hi, I have the following class - class TestOutcomes: PASSED = 0 FAILED = 1 ABORTED = 2 plus the following code - testResult = TestOutcomes.PASSED testResultAsString if testResult == TestOutcomes.PASSED: testResultAsString = "Passed" elif testResult == TestOutcomes.FAILED :