A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078783.html below:

[Python-Dev] unscriptable?

[Python-Dev] unscriptable? [Python-Dev] unscriptable?Georg Brandl g.brandl at gmx.net
Mon Apr 21 19:27:27 CEST 2008
Alexander Belopolsky schrieb:
>> 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'

This is misleading, since it suggests that you can remedy this
by using another type in the subscript, which isn't possible.

Georg

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4