Message164716
This kind of "debug your code" is the kind of thing I've gotten used to from the Clang C/C++ compiler. Granted, compiled languages have an advantage here, but enough residual information remains for the interpreter at runtime.
And I am in no way suggesting that *every* attempt to call a non-function have the extra information.
For the cases where the error message is given, something like:
TypeError: 'tuple' object is not callable (missing preceding comma?)
The case of a homogenous container is the most important case.
I've offered two different ways to figure out whether it's a typo or an attempt to call an object that you honestly think is callable:
1. Is the called object a newly-constructed (refcount=1) tuple literal? (Also works for list, set, and dictionary literals; probably wouldn't work for string literals due to interning)
2. Does the false call occur within a container literal or function call?
I'm not intimately familiar with python bytecode or interpreter, but I'm sure anyone who is could extract this information. |
|
Date |
User |
Action |
Args |
2012-07-06 04:46:15 | o11c | set | recipients:
+ o11c, eric.araujo, steven.daprano |
2012-07-06 04:46:15 | o11c | set | messageid: <1341549975.91.0.176622862713.issue15248@psf.upfronthosting.co.za> |
2012-07-06 04:46:15 | o11c | link | issue15248 messages |
2012-07-06 04:46:14 | o11c | create | |
|