"Jeremy Sanders" <[EMAIL PROTECTED]> wrote:
| Hendrik van Rooyen wrote:
|
| > What do you guys think?
|
| You could get something similar using an object, such as
|
| class Hist(object):
|
| def __init__(self):
| self.vals = [None]
|
| def __call__(self, index=-1):
| r
"Piet van Oostrum" <[EMAIL PROTECTED]> Wrote:
| You are about 7 months early.
| --
Am I? - Early for what - a seven months premature baby is small indeed...
- Hendrik
--
http://mail.python.org/mailman/listinfo/python-list
You are about 7 months early.
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Hendrik van Rooyen wrote:
> What do you guys think?
You could get something similar using an object, such as
class Hist(object):
def __init__(self):
self.vals = [None]
def __call__(self, index=-1):
return self.vals[index]
def set(self, val):
self.vals.appen
"John Machin" <[EMAIL PROTECTED]> wrote:
|
| Hendrik van Rooyen wrote:
| [snip]
| > What do you guys think?
|
| The subject said it all. You should find some other way of entertaining
| yourself on the weekends :-)
This is the right answer...
*grin* - well - at least you *were* warned... -
At Saturday 19/8/2006 07:49, Hendrik van Rooyen wrote:
Now how about introducing an index that works over time,
such that s{0} (the default so as to not break any existing code)
implies the current object bound to the name s,
with s{1} being the previous one, and so on...
Doing that *always* f
Hendrik van Rooyen wrote:
[snip]
> What do you guys think?
The subject said it all. You should find some other way of entertaining
yourself on the weekends :-)
--
http://mail.python.org/mailman/listinfo/python-list
Hendrik van Rooyen wrote:
> Hi there,
>
> I can write:
>
> s = 'some string'
> then print s[1] will be the string 'o'
>
> and a while later I can write:
>
> s = 'other some string'
> then print s[1] will be the string 't'
>
> and then:
>
> s = [1,2,3,4]
> then print s[1] will be the number 2
>
> a
Hi there,
I can write:
s = 'some string'
then print s[1] will be the string 'o'
and a while later I can write:
s = 'other some string'
then print s[1] will be the string 't'
and then:
s = [1,2,3,4]
then print s[1] will be the number 2
and still later:
s = {1:'boo',2:'foo',3:'shoo'}
when pri