Le 23/01/2013 06:17, Lex Trotman a écrit :
Hi All,
We have only one Python filetype, but Python has two versions.
There are some differences between them in terms of keywords and builtins.
For example exec, nonlocal, True, False and None are not keywords for Python 2 but are for 3.
And print is a keyword for 2 but not for 3.
There are similar changes to the builtins.
I don't think these differences are big enough to legitimate the introduction of a new, confusing, filetype just for them. It's not like Python 2 and 3 are different languages, it's just that a *few* things got introduced or removed.
At the moment True, False and None are in the keyword list but exec and nonlocal are not. There is a PR to remove True, False and None.
Please, no.
Since Python 3 is gaining ground I suggest that it would be better to have an aggregate of both Pythons for both keywords and builtins. Whilst that is wrong for both, I think missing keywords is worse than extras.
Agreed. I don't think it's a real problem to have e.g. print as a keyword for Python 3, and I think it's really not a problem to have the Python 3 keywords in Python 2.
What do other Python users think?
As a hobbyist Python writer and Geany developer, one single Python filetype, PLEASE!
Cheers, Colomban