Currently, list.reverse() only works for an entire list. If one wants to 
reverse a section of it 'in-place', one needs to slicing which makes the space 
complexity no longer O(1). One can also manually make a loop and do the 
reversal but that is even slower than slicing. List.reverse() does not take any 
arguments. Wouldn't it be a good if it can take in parameters such as 'start' 
and 'stop' to enable list.reverse() work even for a section of the list? When 
no arguments are specified, then it works on the whole list, like usual.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SQJE27YTHQC6PBL5RLZY4ULKEYQ32YYX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to