[Python-Dev] unscriptable?

Alexander Belopolsky alexander.belopolsky at gmail.com
Mon Apr 21 18:37:57 CEST 2008


> ruby: undefined method `[]=' for 1:Fixnum (NoMethodError)

I think it will be natural to unify [] error message with
the other binary ops:

Now:
>>> 1+""
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'

Proposal:
>>> 1[2]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for []: 'int' and 'int'





More information about the Python-Dev mailing list