<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
| I would like to have something like "option base" in Visual Basic.
| IIRC it used to allow me to choose whether 0 or 1 should be used as
| the base of member indices of arrays. In Python, the same can be used
| with strings, lists, tuples etc.

If you access a sequence with an iterator, perhaps now the most common 
case, the index base becomes an irrelevant internal detail.

If you only access a sequence with explicit indexes, you can treat it as 
1-based by ignoring the first element.  This has been a standard conversion 
technique for a fewdecades.

If you do not like writing range(1,n+1), use def myrange(n): return 
range(1,n+1).  Interface conversion wrappers are another standard 
technique.

Terry Jan Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to