Closed cknv closed 9 years ago
Thanks for your feedback. I think you're correct, del
should probably be scoped as keyword.other
, the same as assert
. I don't think I'll make a new release just for this, but I'll push the change to master, and you can copy the contents to PythonImproved.tmLanguage
.
Please feel free to correct me, but currently, with python3 the
del
keyword gets scoped as a builtin function. The readme states that for python2print
anddel
is still a standalone keyword, but as far I as I am aware nothing changed fordel
in python3.The scopes I see (via ScopeAlways) are:
source.python
support.function.builtin.python
It seems to me that
del
should be present in this line. And perhaps removed from here (and maybe here). Although I could be mistaken as I am not entirely familiar with the way the language file is generated, hence this not being a pull request.To further illustrate my point, this is the output from a python3 repl:
To me this further reiterates that
print
is a function, whiledel
is a keyword. The only keyword that seems to not raise a syntax error on its own ispass
(which makes sense). Furthermore I tried testing if they werecallable
,print
was, whiledel
gives a syntax error (again).For the record, I tried to coerce my code to be pretty with the function highlighting, by adding parenthesis around the target of
del
(basically treating it like a buildtin), but I realized that that was basically the same as putting parenthesis around the target ofyield
,return
, or other keywords. In addition pylint also complained a fair bit about it with thesuperfluous-parens
error.If it was a conscious decision to make
del
scope as a function, I would certainly like to hear the reasoning for it.Finally I would like to mention that I appreciate the work you have put into this, it makes it little bit nicer when writing python3.