diff options
author | robot-piglet <[email protected]> | 2025-08-28 14:27:58 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-08-28 14:57:06 +0300 |
commit | 81d828c32c8d5477cb2f0ce5da06a1a8d9392ca3 (patch) | |
tree | 3081d566f0d5158d76e9093261344f6406fd09f7 /contrib/tools/swig/Lib/python/pythonkw.swg | |
parent | 77ea11423f959e51795cc3ef36a48d808b4ffb98 (diff) |
Intermediate changes
commit_hash:d5b1af16dbe9030537a04c27eb410c88c2f496cd
Diffstat (limited to 'contrib/tools/swig/Lib/python/pythonkw.swg')
-rw-r--r-- | contrib/tools/swig/Lib/python/pythonkw.swg | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/contrib/tools/swig/Lib/python/pythonkw.swg b/contrib/tools/swig/Lib/python/pythonkw.swg new file mode 100644 index 00000000000..a21034524fd --- /dev/null +++ b/contrib/tools/swig/Lib/python/pythonkw.swg @@ -0,0 +1,140 @@ +/* + Warnings for Python keywords, built-in names and bad names. +*/ + +#define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword", rename="_%s") `x` +#define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python") `x` + + +/* + Warnings for Python keywords + https://docs.python.org/2/reference/lexical_analysis.html#keywords +*/ + +PYTHONKW(and); +PYTHONKW(as); +PYTHONKW(assert); +PYTHONKW(async); +PYTHONKW(await); +PYTHONKW(break); +PYTHONKW(class); +PYTHONKW(continue); +PYTHONKW(def); +PYTHONKW(del); +PYTHONKW(elif); +PYTHONKW(else); +PYTHONKW(except); +PYTHONKW(exec); +PYTHONKW(finally); +PYTHONKW(for); +PYTHONKW(from); +PYTHONKW(global); +PYTHONKW(if); +PYTHONKW(import); +PYTHONKW(in); +PYTHONKW(is); +PYTHONKW(lambda); +PYTHONKW(not); +PYTHONKW(or); +PYTHONKW(pass); +PYTHONKW(print); +PYTHONKW(raise); +PYTHONKW(return); +PYTHONKW(try); +PYTHONKW(while); +PYTHONKW(with); +PYTHONKW(yield); + +/* + built-in functions + https://docs.python.org/2/library/functions.html + */ + +PYTHONBN(abs); +PYTHONBN(apply); +PYTHONBN(bool); +PYTHONBN(buffer); +PYTHONBN(callable); +PYTHONBN(chr); +PYTHONBN(classmethod); +PYTHONBN(cmp); +PYTHONBN(coerce); +PYTHONBN(compile); +PYTHONBN(complex); +PYTHONBN(delattr); +PYTHONBN(dict); +PYTHONBN(dir); +PYTHONBN(divmod); +PYTHONBN(enumerate); +PYTHONBN(eval); +PYTHONBN(execfile); +PYTHONBN(file); +PYTHONBN(filter); +PYTHONBN(float); +PYTHONBN(frozenset); +PYTHONBN(getattr); +PYTHONBN(globals); +PYTHONBN(hasattr); +PYTHONBN(hash); +PYTHONBN(hex); +PYTHONBN(id); +PYTHONBN(input); +PYTHONBN(int); +PYTHONBN(intern); +PYTHONBN(isinstance); +PYTHONBN(issubclass); +PYTHONBN(iter); +PYTHONBN(len); +PYTHONBN(list); +PYTHONBN(locals); +PYTHONBN(long); +PYTHONBN(map); +PYTHONBN(max); +PYTHONBN(min); +PYTHONBN(object); +PYTHONBN(oct); +PYTHONBN(open); +PYTHONBN(ord); +PYTHONBN(pow); +PYTHONBN(property); +PYTHONBN(range); +PYTHONBN(raw_input); +PYTHONBN(reduce); +PYTHONBN(reload); +PYTHONBN(repr); +PYTHONBN(reversed); +PYTHONBN(round); +PYTHONBN(set); +PYTHONBN(setattr); +PYTHONBN(slice); +PYTHONBN(sorted); +PYTHONBN(staticmethod); +PYTHONBN(str); +PYTHONBN(sum); +PYTHONBN(super); +PYTHONBN(tuple); +PYTHONBN(type); +PYTHONBN(unichr); +PYTHONBN(unicode); +PYTHONBN(vars); +PYTHONBN(xrange); +PYTHONBN(zip); + + +/* + built-in names + boolean type and None +*/ +PYTHONBN(True); +PYTHONBN(False); + +PYTHONKW(None); + + +/* + 'self' is also a bad Name +*/ +PYTHONKW(self); + +#undef PYTHONBN +#undef PYTHONKW |