[Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses
"Martin v. Löwis"
martin at v.loewis.de
Sat Jun 17 21:09:06 CEST 2006
Noam Raphael wrote:
> I meant the extra code for writing a special class to handle scalars,
> if I decide that the "x[()]" syntax is too ugly or too hard to type,
> so I write a special class which will allow the syntax "x.value".
What I cannot understand is why you use a zero-dimensional array to
represent a scalar. Scalars are directly supported in Python:
x = 5
Also, in an assignment, what are you putting on the right-hand side?
A read access from another zero-dimensional array?
I think this feature is so esoteric that it would actually hurt the
language to have it.
More information about the Python-Dev