[Python-ideas] Crazy idea: allow keywords as names in certain positions

Greg Ewing greg.ewing at canterbury.ac.nz
Mon May 14 18:58:39 EDT 2018


Terry Reedy wrote:
> the first two 'and's in "a and b.and # and error" are tagged. 
> To not tag the second would require full parsing,

That particular case could be handled by just not colouring
any word following a dot.

Some other situations might result in false positives, but
there are cases like that already. Many Python colourisers
colour any occurrence of a builtin function name, even if
it has been shadowed, and people seem to live with that.

It might even be useful, if it alerts people that a name
they're using is reserved in some contexts, and so might
be best avoided.

-- 
Greg



More information about the Python-ideas mailing list