Dustan wrote:
For newbies, it's easier to count starting with 1. It's rather
unintuitive to start at 0.
Cool. So Python will become a newbie language, and everyone
that jumps from Python to a different language will have to
relearn 0-based indices? ;)
Regards,
Björn
--
BOFH excuse #418:
On 2007-04-14, Paddy [EMAIL PROTECTED] wrote:
On Apr 14, 11:27 am, [EMAIL PROTECTED] wrote:
This is like the previous one. Please check for sanity and approve for
posting at python-dev.
I would like to have something like option base in Visual Basic.
IIRC it used to allow me to choose
Beliavsky [EMAIL PROTECTED] wrote:
Fortran has allowed a user-specified base since at least the 1977
standard -- see for example
http://www.umiacs.umd.edu/~jhu/DOCS/SP/docs/essl/essl159.html
.
You can strike at least; this extension was introduced in FORTRAN 77.
FORTRAN 66 didn't do this.
--
On Apr 14, 4:06 pm, Bjoern Schliessmann usenet-
[EMAIL PROTECTED] wrote:
jamadagni wrote:
OK fine. It is clear that this feature must be implemented if at
all only on a per-module basis. So can we have votes for
per-module implementation of this feature?
I don't think it's worth the
On Mon, 16 Apr 2007 10:15:19 +0200, Javier Bezos
[EMAIL PROTECTED] wrote:
Paddy,
Dijkstra's argument is obsolete, as it is based on
how array length was computed many years ago -- if
we have an array a = b..e, then the lenght of a
is e-b (half open range). Good at low level
programming.
Paddy,
Dijkstra's argument is obsolete, as it is based on
how array length was computed many years ago -- if
we have an array a = b..e, then the lenght of a
is e-b (half open range). Good at low level
programming.
But a quarter of a century after we know concepts
are much better than low
Sherm Pendley [EMAIL PROTECTED] wrote:
Paddy [EMAIL PROTECTED] writes:
Having more than one index start point would be a maintenance
nightmare best avoided.
Quite right.
(It can be done in Perl).
When was the last time you used Perl? It was allowed in Perl 4 and earlier,
Here is a document giving good reasons for indexing to start at
zero, as in Python.
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
The author has done a bit:
http://en.wikipedia.org/wiki/Dijkstra
Dijkstra's argument is obsolete, as it is based on
how array length was
On Apr 15, 6:42 pm, Javier Bezos [EMAIL PROTECTED] wrote:
Here is a document giving good reasons for indexing to start at
zero, as in Python.
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
The author has done a bit:
http://en.wikipedia.org/wiki/Dijkstra
Dijkstra's
On Apr 14, 10:55 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
snip
The FORTRAN family had started as 1-based (F95, and Ada, now allow
for each array to have its own base = x : array (-10..10) of float).
Fortran has allowed a user-specified base since at least the 1977
standard --
On Apr 14, 10:12 pm, Paddy [EMAIL PROTECTED] wrote:
snip
So the running count is:
Ayes to the left: VB compatibility.
Nays to the right: QuadIO, Perl, Dijkstra paper.
The nays have it!
One-based indexing would also Python more compatible with Fortran,
Matlab/Octave/Scilab, and S
On Apr 15, 6:06 pm, Beliavsky [EMAIL PROTECTED] wrote:
On Apr 14, 10:12 pm, Paddy [EMAIL PROTECTED] wrote:
snip
So the running count is:
Ayes to the left: VB compatibility.
Nays to the right: QuadIO, Perl, Dijkstra paper.
The nays have it!
One-based indexing would also Python
This is like the previous one. Please check for sanity and approve for
posting at python-dev.
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
[EMAIL PROTECTED] 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
On Apr 14, 4:01 pm, Martin v. Löwis [EMAIL PROTECTED] wrote:
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.
I do not request for this to be changed per-module. Once I say
something like:
from __future__
In [EMAIL PROTECTED], jamadagni
wrote:
On Apr 14, 4:01 pm, Martin v. Löwis [EMAIL PROTECTED] wrote:
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.
I do not request for this to be changed per-module.
Modules are parsed when they are imported. And some modules are already
imported before your module is imported because they are built-in or
loaded to be able to import your module in the first place. And what
about modules that are written in C?
OK fine. It is clear that this feature must
jamadagni wrote:
Modules are parsed when they are imported. And some modules are already
imported before your module is imported because they are built-in or
loaded to be able to import your module in the first place. And what
about modules that are written in C?
OK fine. It is clear that
On Apr 14, 1:27 pm, [EMAIL PROTECTED] wrote:
...
This would mean:
foo = foo
= foo[1] == 'f'
class Str1(str):
def __getitem__(self,i):
return str.__getitem__(self,i-1)
s1 = Str1(foo)
print s1[1]
--
http://mail.python.org/mailman/listinfo/python-list
jamadagni wrote:
OK fine. It is clear that this feature must be implemented if at all
only on a per-module basis. So can we have votes for per-module
implementation of this feature?
The only way that can work is if the API to the module doesn't expose
ANY sequence indices. It would be a
On Apr 14, 6:27 am, [EMAIL PROTECTED] wrote:
This is like the previous one. Please check for sanity and approve for
posting at python-dev.
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
On Apr 14, 11:27 am, [EMAIL PROTECTED] wrote:
This is like the previous one. Please check for sanity and approve for
posting at python-dev.
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
Paddy [EMAIL PROTECTED] writes:
Having more than one index start point would be a maintenance
nightmare best avoided.
Quite right.
(It can be done in Perl).
When was the last time you used Perl? It was allowed in Perl 4 and earlier,
because many Perl users were moving from Awk, which uses
On Apr 14, 8:27 pm, [EMAIL PROTECTED] wrote:
This is like the previous one. Please check for sanity and approve for
posting at python-dev.
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
On Apr 14, 8:55 pm, Sherm Pendley [EMAIL PROTECTED] wrote:
Paddy [EMAIL PROTECTED] writes:
Having more than one index start point would be a maintenance
nightmare best avoided.
Quite right.
(It can be done in Perl).
When was the last time you used Perl? It was allowed in Perl 4 and
jamadagni wrote:
OK fine. It is clear that this feature must be implemented if at
all only on a per-module basis. So can we have votes for
per-module implementation of this feature?
I don't think it's worth the hassle. BTW, what's, IYHO, the distinct
advantage of starting array indices at 1?
Paddy [EMAIL PROTECTED] writes:
I don't think we should add it to Python
because it would make porting VB code easier.
Great Cthulhu no!
I chimed in because your first comment regarding Perl implied that it's
commonplace for Perl programmers to fiddle with the index base. It can
be done, for
[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
faulkner [EMAIL PROTECTED] wrote:
...
__future__ is used to access upcoming features, and changing the base
offset is not [and never will be] slated for future development. zero
has been used as the base offset in all real languages since the dawn
of time, and isn't something that can be
Sherm Pendley [EMAIL PROTECTED] wrote:
Paddy [EMAIL PROTECTED] writes:
I don't think we should add it to Python
because it would make porting VB code easier.
Great Cthulhu no!
I chimed in because your first comment regarding Perl implied that it's
commonplace for Perl programmers to
On Apr 15, 2:29 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
Sherm Pendley [EMAIL PROTECTED] wrote:
Paddy [EMAIL PROTECTED] writes:
I don't think we should add it to Python
because it would make porting VB code easier.
Great Cthulhu no!
I chimed in because your first comment
On Apr 14, 10:55 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
The FORTRAN family had started as 1-based (F95, and Ada, now allow
for each array to have its own base = x : array (-10..10) of float).
Pascal, I forget...
Pascal allows arbitrary array bases. It's where Ada got the
On Sat, 14 Apr 2007 20:34:46 -0700, Dan Bishop wrote:
On Apr 14, 10:55 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
The FORTRAN family had started as 1-based (F95, and Ada, now allow
for each array to have its own base = x : array (-10..10) of float).
Pascal, I forget...
Pascal
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Sat, 14 Apr 2007 20:34:46 -0700, Dan Bishop wrote:
On Apr 14, 10:55 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
The FORTRAN family had started as 1-based (F95, and Ada, now allow
for each array to have its own base = x : array
34 matches
Mail list logo