range(len(x)) is actually not that important. You probably need to be using enumerate() more often.

On Fri, Apr 10, 2020 at 9:44 PM Chamoun Saoma <csaoma@gmail.com> wrote:
I have an idea to improve the python language through the creation of a new and very readable function.


#################
def ranlen(x):
#range of length of x
      return range(len(x))
#################

This will be a simple to use and very readable way of creating ranges of indexes. I hope for this to become a new pythogenic way of writing code, especially because using range(leng(x)) is so essential when implementing various algorithms.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/FZYSNZN2R2GPA2SKGWYFU3BUCSE3TNF2/
Code of Conduct: http://python.org/psf/codeofconduct/