[Python-Dev] Inconsistent error messages in Py{Object, Sequence}_SetItem()

Greg Ward gward at python.net
Sun Oct 26 14:55:15 EST 2003


I just noticed a subtle inconsistency in the error messages when trying
to assign to a tuple:

  >>> (1,)[0] = "foo"
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  TypeError: object doesn't support item assignment
  >>> (1,)['foo'] = "foo"
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  TypeError: object does not support item assignment

Note the "doesn't" vs "does not".  It's easily tracked down to
PyObject_SetItem() and PySequence_SetItem() (in Objects/abstract.c).

Is this deliberate, or a simple oversight?  I'm inclined to assume the
latter, and change "doesn't" to "does not" on the grounds that error
messages are formal writing, and I was taught not to use contractions in
formal writing.

Any objections?

        Greg
-- 
Greg Ward <gward at python.net>                         http://www.gerg.ca/
Eschew obfuscation!



More information about the Python-Dev mailing list