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/078765.html below:

[Python-Dev] unscriptable?

[Python-Dev] unscriptable? [Python-Dev] unscriptable?Steve Holden steve at holdenweb.com
Sun Apr 20 03:54:46 CEST 2008
Nick Coghlan wrote:
[...]>
> To suggest yet another colour for the bikeshed, maybe we should ditch 
> both unindexable and unsubscriptable and go with "'int' is not a 
> sequence or mapping". Any object which supports subscript notation will 
> be one or the other.
> 
All the object needs to to to be "indexable" or "subscriptable" is to 
implement .__index__() or .__getitem__(). While sequences and mappings 
are the only built-in types to do so, this says nothing about 
user-defined types.

Couldn't we find a more obvious and direct error message like

"Illegal use of [] subscripting/indexing"?

one-more-coat-for-the-bikeshed-ly y'rs  - steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

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