[Python-Dev] PEP 318 and syntax coloring (original) (raw)

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Mar 29 18:42:24 EST 2004


Skip Montanaro <skip at pobox.com>:

Has anyone considered the side effect of any of these proposals would have on auxiliary tools like syntax-directed editors, other code colorizers, etc?

Yes, and those considerations point towards it being a bad idea to put anything either between the 'def' and the function name, or between the function name and the arg list. Doing either of those is likely to break any existing tools that think they know what a function definition looks like.

Teaching those tools about the new syntax could also be quite difficult, since e.g. it may no longer be possible to express what is being looked for using a regular expression.

So I think I'm against my own suggestion of putting the descriptor decorator before the arg list. But I still think it may be worth distinguishing it syntactically somehow, since it does something very different from the others, and the user will have to know that.

Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg at cosc.canterbury.ac.nz +--------------------------------------+



More information about the Python-Dev mailing list