Since I opened the ticket that led to this, I'll weight in. I was quite happy to see variable name highlighting as a new feature, but I would like to see it used only in assignments. I find it convenient to have a visual cue that tells me when names are rebound. In many cases it homes me in on where the change occurred faster than doing a search.
But if the object to which the name is bound is being modified, NOT rebound, then do not highlight (so, slicing should not get highlight). If you start highlight variables anytime they get modified, you get into hot water because method calls might/might not modify them, and you really have no way of knowing that. But re-binding is (usually) easy to detect syntactically. Yes, I am also against indiscriminately highlighting variable names in any expression. That is too much and too messy. In the ideal world, I would like to see this: # Highlight "someVar" someVar = [] someObj.someVar = 5 # someObj also highlighted maybe? someVar1, someVar2 = val1, val2 # highlight both "someVar1" and "someVar2" # DO NOT highlight "someVar" if someVar == None: ... otherVar = someVar * 100 someVar.someMethod() someVar[i:j] = [1,2,3] # modified, but NOT rebound someVar[k] = None # modified, but NOT rebound And this next case is really debatable: foo = someFunc (someName = val) Highlight "someName" or not? If highlighting means (re)binding a name, then yes, this should be highlighted to show "someName" is being "assigned" a value for this function. For the record, I'm in favor of highlighting in this case. If that is too much, then as a minimum it would be nice to have "someVar" highlighted in these cases: someVar = [] someObj.someVar = 5 Cheers, Andrew U. _______________________________________________ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode