Thanks everyone!!:-) Nicks solution coupled with John's modifications
worked great for 2.2!! Yipeee...!!:):)
--
http://mail.python.org/mailman/listinfo/python-list
clementine wrote:
> Thanx Nick...I forgot to mention im using python 2.2 and along with a
host
> of other things it doesnt seem to have the enumarate built in
function
> :(:(:(...is it possible to replace it by something else? I dont think
> simulating it will be feasible
Faced with Nick's on
Scott David Daniels wrote:
or even (if you can't be bothered to look up when features happened):
try:
test = enumerate
except NameError:
def enumerate(iterable):
...
try:
test = sorted
except NameError:
def sorted(iterable, cmp=None, key=N
Fuzzyman wrote:
Iterators are available in python 2.2
class enumerate:
def __init__(self, inlist):
self.inlist = inlist
self.index = 0
def next(self):
if self.index >= len(self.inlist): raise StopIteration
thisone = self.inlist[self.index]
self.index
Scott David Daniels wrote:
> if sys.version_info < (2, 4):
> def sorted(iterable, cmp=None, key=None, reverse=False):
> "return a sorted copy of its input"
> seq = list(iterable)
> if reverse:
> seq.reverse()# preserve s
Nick Coghlan wrote:
def mysort(iterable, cmp=None, key=None, reverse=False):
"return a sorted copy of its input"
if sys.version_info >= (2,4):
return sorted(iterable, cmp, key, reverse)
seq = list(iterable)
if reverse:
seq.reverse()# preserve stability
if
Sion Arrowsmith wrote:
> clementine <[EMAIL PROTECTED]> wrote:
> >Thanx Nick...I forgot to mention im using python 2.2 and along with
a host
> >of other things it doesnt seem to have the enumarate built in
function
> >:(:(:(...is it possible to replace it by something else? I dont
think
> >simulat
clementine <[EMAIL PROTECTED]> wrote:
>Thanx Nick...I forgot to mention im using python 2.2 and along with a host
>of other things it doesnt seem to have the enumarate built in function
>:(:(:(...is it possible to replace it by something else? I dont think
>simulating it will be feasible
Here'
Thanx Nick...I forgot to mention im using python 2.2 and along with a host
of other things it doesnt seem to have the enumarate built in function
:(:(:(...is it possible to replace it by something else? I dont think
simulating it will be feasible
--
http://mail.python.org/mailman/listinfo/pyt
clementine wrote:
Hi,
I have an array of arrays in the form of
list = [[3,'fork',0.3,1],[2,'fork,0.1,2],[3,'exec',0.2,2]]
The in-built sort(),list.sort() sorts on the first element, if the first
elts are equal then it sorts on the second elt and so on...But i really
dont want to search on the sec
Hi,
I have an array of arrays in the form of
list = [[3,'fork',0.3,1],[2,'fork,0.1,2],[3,'exec',0.2,2]]
The in-built sort(),list.sort() sorts on the first element, if the first
elts are equal then it sorts on the second elt and so on...But i really
dont want to search on the second elt if the fi
11 matches
Mail list logo