Python Feature Request: Allow changing base of member indices to 1

"Martin v. Löwis" martin at v.loewis.de
Sat Apr 14 07:01:12 EDT 2007


samjnaa at gmail.com schrieb:
> This is like the previous one. Please check for sanity and approve for
> posting at python-dev.

This one is not sane. It's not possible to change the indexing of
objects on a per-module basis, as objects may cross module boundaries.

Suppose you have this code:

option base
import sys
print sys.path[1]

So should the be 0-based (because path is in module sys), or should
it be one-based (because the access occurs in a module that uses
1-indexing)?

Regards,
Martin



More information about the Python-list mailing list