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/

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to