Re: Accessing object parent properties

2006-05-23 Thread Ryan Forsythe
Cloudthunder wrote: > How can I set up method delegation so that I can do the following: > > A.run() > > and have this call refer to the run() method within the boo instance? Also, > what if I have tons of functions like run() within the boo instance and I > want all them to be directly accessib

Re: sort a list of files

2006-05-06 Thread Ryan Forsythe
robably want sorted(blah): >>> a = [3, 1, 4, 1, 5, 9] >>> sorted(a) [1, 1, 3, 4, 5, 9] >>> a [3, 1, 4, 1, 5, 9] >>> a.sort() >>> a [1, 1, 3, 4, 5, 9] -- Ryan Forsythe -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN handling

2006-05-06 Thread Ryan Forsythe
Terry Reedy wrote: > "Felipe Almeida Lessa" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> This works everywhere: >> >> nan = float('nan') > > Not. > nan = float('nan') > > Traceback (most recent call last): > File "", line 1, in -toplevel- > nan = float('nan') > Va

Re: Replace

2006-05-05 Thread Ryan Forsythe
Eric wrote: > I have a string... > > str = "tyrtrbd =ffgtyuf == =tyryr =u=p ff" > > I want to replace the characters after each '=', what I ended up doing is > somthing like this... > > buf = list(str) > newchr = '#' > > count = 0 > for i in range(len(buf)): > if buf[count] == '=': >

Re: scope of variables

2006-05-03 Thread Ryan Forsythe
Gary Wessle wrote: > the example was an in-accuretlly representation of a the problem I am > having. my apologies. > > a = [] > def prnt(): >print len(a) > prnt > > > I expect to get 0 "the length of list a" You want prnt(), not prnt: >>> a = [] >>> def prnt(): ... print len(a) ...