[issue15248] In "TypeError: 'tuple' object is not callable", suggest a comma.

Ben Longbons report at bugs.python.org
Wed Jul 4 07:28:42 CEST 2012


New submission from Ben Longbons <b.r.longbons at gmail.com>:

I frequently construct lists of tuples, such as:
[
  (1, 2, 3) # oops, missing comma!
  (4, 5, 6)
]

It would be nice if the error message gave a hint on what was *actually* wrong.

Although I always use homogeneous containers, the type that's not callable could be something other than 'tuple'.

You could possibly cut down on false positives (at the risk of false negatives) by checking that the not-callable object is newly constructed.

A better way to cut down on false positives would be to check that a list, tuple, or set is being constructed from a literal, but this might be more complex.

----------
messages: 164637
nosy: o11c
priority: normal
severity: normal
status: open
title: In "TypeError: 'tuple' object is not callable", suggest a comma.
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15248>
_______________________________________


More information about the Python-bugs-list mailing list