Re: [Python-mode] Poll - Fwd: [Bug 858304] [NEW] variable name is highighted on LHS of equality (==) test, but shouldn't be
On Sun, Sep 25, 2011 at 10:20 PM, Andreas Röhler andreas.roeh...@online.de wrote: Am 25.09.2011 22:31, schrieb Barry Warsaw: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On Sep 25, 2011, at 06:58 PM, Georg Brandl wrote: if anything is highlighted, then it should be only locals at assignment. Highlighting other assignments gets much too messy on the eyes (and if you start highlighting variable (no such thing in Python anyway) names on access too, you will have to color most of the code... Agreed, and personally, even highlighting assignments is too fruit salady for me so I'm glad it can be turned off. ;) - -Barry will sett the default to nil Andreas Sorry for the naive question, but... since it's off by default, how do I turn it back on? Thanks, Andrew U. ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode
[Python-mode] Poll - Fwd: [Bug 858304] [NEW] variable name is highighted on LHS of equality (==) test, but shouldn't be
Hi folks, possibility of highlighting variable name is a new feature in the trunk. It's not clear however, in which circumstances variable should get highlighted -if at all. Also might drop that, should it not be considered useful. Would be nice to get some comments before a release. Thanks, Andreas Original-Nachricht Betreff: [Bug 858304] [NEW] variable name is highighted on LHS of equality (==) test, but shouldn't be Datum: Sat, 24 Sep 2011 15:58:38 - Von: Andrew Uzilov 858...@bugs.launchpad.net Antwort an: Bug 858304 858...@bugs.launchpad.net An: andreas.roeh...@online.de Public bug reported: This pertains to the lp:python-mode branch, I think this bug does not occur in 6.0.2. LHS of equality (==) tests now gets highlighted, but it shouldn't. The highlighting should only be for LHS on assignment (=) expressions. For example: if someVar == 5: doSomething() someVar is highlighted. However, if you wrap it with something, like this: if len (someVar) == 5: doSomething() someVar is not highlighted. ** Affects: python-mode Importance: Undecided Status: New -- You received this bug notification because you are subscribed to python- mode.el. https://bugs.launchpad.net/bugs/858304 Title: variable name is highighted on LHS of equality (==) test, but shouldn't be To manage notifications about this bug go to: https://bugs.launchpad.net/python-mode/+bug/858304/+subscriptions ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode
[Python-mode] Poll - Fwd: [Bug 858304] [NEW] variable name is highighted on LHS of equality (==) test, but shouldn't be
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
Re: [Python-mode] Poll - Fwd: [Bug 858304] [NEW] variable name is highighted on LHS of equality (==) test, but shouldn't be
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On Sep 25, 2011, at 06:58 PM, Georg Brandl wrote: if anything is highlighted, then it should be only locals at assignment. Highlighting other assignments gets much too messy on the eyes (and if you start highlighting variable (no such thing in Python anyway) names on access too, you will have to color most of the code... Agreed, and personally, even highlighting assignments is too fruit salady for me so I'm glad it can be turned off. ;) - -Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJOf4+kAAoJEBJutWOnSwa/CC4P/1Ka6UxRYaLXan+y9dFe5Olc uV0tsT3HULuvi9aHgn4n2a6MrO0CChRESxp3Th3KrUHJMWaZYRhFXbTSofddC6CX OlbeuPJJDYeiv83A5k3EXOlcUZEtp8E1sbbFF3MLNbau7wdfb2ZM/COb0OWegSf9 qNU6yzTrcvxtaJ0ro0gFT7QthEa3GB43kGnhVxie5CteAkH1/v9KbmhL876BCm9L ysfx2dYwDqjnxezxZkTsunUci3+MSxjIBi3UJZNuwWQQY1Vh2YIOXsBQBaj78UtJ W8VtKNeL+IIewWmMzK2jkvw8NEgwFT5QtuULK/DqaMSyuJ7hDbsq0gAAhaf76dDw hJqBE2WDatVkGomnCQmoTZRrjd+EOLmnXgOxPE2Zr3hwLxmkJ822dDiJIjuLbi// QbVOUxTrw/KikEOezFc+RsmpSZvCBjR2zZZWIvua2MILOGVj0/1+LWU+zs5W6rzN cpDGHFiZc8+PZDYjtvniSG+uqZbVpMLwqbxIc2H4muThl/+X4OjTM2TnZtS1m2Dp whYf8zkxkNcriCiXHXGIQtshWnXQJyeYCESQqBqAzYuJui4UKrNHqrU9jLyw18TC ynAvkGwNyvOvMm0gGvHY0kEAmEGhNSnmGbPoh5pq+ij5Q/C//BcQtmagpPcgR9Pi cZubnJpdvII2Xm0KjZ7U =GlSw -END PGP SIGNATURE- ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode
Re: [Python-mode] Poll - Fwd: [Bug 858304] [NEW] variable name is highighted on LHS of equality (==) test, but shouldn't be
Am 25.09.2011 22:31, schrieb Barry Warsaw: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On Sep 25, 2011, at 06:58 PM, Georg Brandl wrote: if anything is highlighted, then it should be only locals at assignment. Highlighting other assignments gets much too messy on the eyes (and if you start highlighting variable (no such thing in Python anyway) names on access too, you will have to color most of the code... Agreed, and personally, even highlighting assignments is too fruit salady for me so I'm glad it can be turned off. ;) - -Barry will sett the default to nil Andreas ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode