Terry J. Reedy <tjre...@udel.edu> added the comment:

I have a mixed opinion of this.  On the one hand, 'string index', taken out of 
context, *is* ambiguous.  (In the context of the TypeError message, it took me 
a minute to see the string-index interpretation.)  On the other hand, dicts do 
not have indices.  They have keys.  So only the 'index of string' 
interpretation makes sense.

Is there anything in the docs that suggests that a mapping subscript can be 
called an 'index' in addition to 'key'?

It would be nicer if this TypeError message also included 'not x', but there 
may be an issue that the type x info is lost.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35077>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

  • ... coyot linden
    • ... శ్రీనివాస్ రెడ్డి తాటిపర్తి
    • ... శ్రీనివాస్ రెడ్డి తాటిపర్తి
    • ... Serhiy Storchaka
    • ... Karthikeyan Singaravelan
    • ... coyot linden
    • ... Terry J. Reedy
    • ... Terry J. Reedy
    • ... coyot linden
    • ... Terry J. Reedy
    • ... coyot linden

Reply via email to