Re: Implementing a circular counter using property / descriptors?

2006-10-09 Thread Gerard Flanagan
IloChab wrote: I'd like to implement an object that represents a circular counter, i.e. an integer that returns to zero when it goes over it's maxVal. This counter has a particular behavior in comparison: if I compare two of them an they differ less than half of maxVal I want that, for

Implementing a circular counter using property / descriptors?

2006-10-08 Thread IloChab
I'd like to implement an object that represents a circular counter, i.e. an integer that returns to zero when it goes over it's maxVal. This counter has a particular behavior in comparison: if I compare two of them an they differ less than half of maxVal I want that, for example, 0 maxVal gives

Re: Implementing a circular counter using property / descriptors?

2006-10-08 Thread Steven D'Aprano
On Sun, 08 Oct 2006 12:25:10 +0200, IloChab wrote: I'd like to implement an object that represents a circular counter, i.e. an integer that returns to zero when it goes over it's maxVal. [snip] The python problem that I give you it's about style. I'd like to write in my code something that