In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
Thank you but your advice doesn't fit in my case since I want to keep
the memory usage and the initial time minimum. iterable[::-1] would
build another list and it would take big memory and time during
reversing if iterable were huge.
[EMAIL PROTECTED] wrote:
Thank you but your advice doesn't fit in my case since I want to keep
the memory usage and the initial time minimum. iterable[::-1] would
build another list and it would take big memory and time during
reversing if iterable were huge. (and the iterable wouldn't be
[EMAIL PROTECTED] wrote:
Thank you but your advice doesn't fit in my case since I want to keep
the memory usage and the initial time minimum. iterable[::-1] would
build another list and it would take big memory and time during
reversing if iterable were huge. (and the iterable wouldn't be
I guess print is using the __repr__ (or __str__ ?) methods of lsit -
which you will need to override as well.
Regards,
Fuzzy
http://www.voidspace.org.uk/python/index.shtml
--
http://mail.python.org/mailman/listinfo/python-list
Fuzzyman wrote:
I guess print is using the __repr__ (or __str__ ?) methods of lsit -
which you will need to override as well.
Regards,
Fuzzy
http://www.voidspace.org.uk/python/index.shtml
Thank you but the problem is that I have to express my intention in
duplicate places -- __iter__(along
[EMAIL PROTECTED] wrote:
p.s. the reason I'm not sticking to reversed or even reverse : suppose
the size of the list is huge.
Reversed is an iterator - it does NOT copy the list. In other words, reversed
already does pretty much what you want.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL
[EMAIL PROTECTED] wrote:
Fuzzyman wrote:
I guess print is using the __repr__ (or __str__ ?) methods of lsit
-
which you will need to override as well.
Regards,
Fuzzy
http://www.voidspace.org.uk/python/index.shtml
Thank you but the problem is that I have to express my intention in
[EMAIL PROTECTED] wrote:
p.s. the reason I'm not sticking to reversed or even reverse : suppose
the size of the list is huge.
reversed() returns an iterator so list size shouldn't be an issue.
What problem are you actually trying to solve?
Kent
--
Kent Johnson wrote:
[EMAIL PROTECTED] wrote:
p.s. the reason I'm not sticking to reversed or even reverse :
suppose
the size of the list is huge.
reversed() returns an iterator so list size shouldn't be an issue.
What problem are you actually trying to solve?
Kent
Oh, you are right.
[EMAIL PROTECTED] wrote:
Kent Johnson wrote:
[EMAIL PROTECTED] wrote:
p.s. the reason I'm not sticking to reversed or even reverse :
suppose
the size of the list is huge.
reversed() returns an iterator so list size shouldn't be an issue.
What problem are you actually trying to solve?
Kent
Oh, you
Michael Spencer wrote:
[EMAIL PROTECTED] wrote:
Kent Johnson wrote:
[EMAIL PROTECTED] wrote:
p.s. the reason I'm not sticking to reversed or even reverse :
suppose
the size of the list is huge.
reversed() returns an iterator so list size shouldn't be an issue.
What problem
Jane Austine wrote:
Please see the following code:
class rev_wrap(object):
def __init__(self,l):
self.l=l
def __getitem__(self,i):
return self.l[-i-1]
class rev_subclass(list):
def __getitem__(self,i):
return
12 matches
Mail list logo