Adding missing built-in functions and names to pythonkw.swg and
fixing operator! warning code in python.swg git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5573 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6a6403d2bc
commit
ca3b23e9ca
2 changed files with 66 additions and 9 deletions
|
|
@ -734,7 +734,7 @@ DIRECTOROUT_TYPEMAP(std::size_t, PyInt_AsLong);
|
||||||
%ignorewarn("362:operator= ignored") operator=;
|
%ignorewarn("362:operator= ignored") operator=;
|
||||||
%ignorewarn("383:operator++ ignored") operator++;
|
%ignorewarn("383:operator++ ignored") operator++;
|
||||||
%ignorewarn("384:operator-- ignored") operator--;
|
%ignorewarn("384:operator-- ignored") operator--;
|
||||||
%ignorewarn("385:operator! ignored") operator!;
|
%ignorewarn("361:operator! ignored") operator!;
|
||||||
%ignorewarn("381:operator&& ignored") operator&&;
|
%ignorewarn("381:operator&& ignored") operator&&;
|
||||||
%ignorewarn("382:operator|| ignored") operator||;
|
%ignorewarn("382:operator|| ignored") operator||;
|
||||||
%ignorewarn("386:operator->* ignored") operator->*;
|
%ignorewarn("386:operator->* ignored") operator->*;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
#ifndef __python_pythonkw_swg__
|
#ifndef __python_pythonkw_swg__
|
||||||
#define __python_pythonkw_swg__
|
#define __python_pythonkw_swg__
|
||||||
|
|
||||||
/* Warnings for Python keywords */
|
|
||||||
#define PYTHONKW(x) %namewarn("314:" #x " is a python keyword") #x
|
#define PYTHONKW(x) %namewarn("314:" #x " is a python keyword") #x
|
||||||
|
#define PYTHONBN(x) %namewarn("321:" #x " conflicts with a built-in name in python") "::"#x
|
||||||
|
|
||||||
|
/*
|
||||||
|
Warnings for Python keywords
|
||||||
|
http://www.fnorb.org/docs/1.2/Fnorb-Guide/node62.html
|
||||||
|
*/
|
||||||
|
|
||||||
PYTHONKW(and);
|
PYTHONKW(and);
|
||||||
PYTHONKW(assert);
|
PYTHONKW(assert);
|
||||||
|
|
@ -34,23 +39,75 @@ PYTHONKW(try);
|
||||||
PYTHONKW(while);
|
PYTHONKW(while);
|
||||||
PYTHONKW(yield);
|
PYTHONKW(yield);
|
||||||
|
|
||||||
#undef PYTHONKW
|
/*
|
||||||
|
built-in functions
|
||||||
|
http://www.zvon.org/other/python/doc21/lib/built-in-funcs.html
|
||||||
|
*/
|
||||||
|
|
||||||
#define PYTHONBN(x) %namewarn("321:" #x " conflicts with a built-in name in python") "::"#x
|
PYTHONBN(abs);
|
||||||
|
PYTHONBN(apply);
|
||||||
/* recurrent built-in functions */
|
PYTHONBN(buffer);
|
||||||
PYTHONBN(close);
|
PYTHONBN(callable);
|
||||||
|
PYTHONBN(chr);
|
||||||
|
PYTHONBN(cmp);
|
||||||
|
PYTHONBN(coerce);
|
||||||
|
PYTHONBN(compile);
|
||||||
|
PYTHONBN(complex);
|
||||||
|
PYTHONBN(delattr);
|
||||||
|
PYTHONBN(dir);
|
||||||
|
PYTHONBN(divmod);
|
||||||
|
PYTHONBN(eval);
|
||||||
|
PYTHONBN(execfile);
|
||||||
|
PYTHONBN(filter);
|
||||||
PYTHONBN(float);
|
PYTHONBN(float);
|
||||||
PYTHONBN(int);
|
PYTHONBN(getattr);
|
||||||
|
PYTHONBN(globals);
|
||||||
|
PYTHONBN(hasattr);
|
||||||
|
PYTHONBN(hash);
|
||||||
|
PYTHONBN(hex);
|
||||||
|
PYTHONBN(id);
|
||||||
PYTHONBN(input);
|
PYTHONBN(input);
|
||||||
|
PYTHONBN(int);
|
||||||
|
PYTHONBN(intern);
|
||||||
|
PYTHONBN(isinstance);
|
||||||
|
PYTHONBN(issubclass);
|
||||||
|
PYTHONBN(len);
|
||||||
|
PYTHONBN(list);
|
||||||
|
PYTHONBN(locals);
|
||||||
|
PYTHONBN(long);
|
||||||
|
PYTHONBN(map);
|
||||||
|
PYTHONBN(max);
|
||||||
|
PYTHONBN(min);
|
||||||
|
PYTHONBN(oct);
|
||||||
PYTHONBN(open);
|
PYTHONBN(open);
|
||||||
|
PYTHONBN(ord);
|
||||||
|
PYTHONBN(pow);
|
||||||
PYTHONBN(range);
|
PYTHONBN(range);
|
||||||
|
PYTHONBN(raw_input);
|
||||||
|
PYTHONBN(reduce);
|
||||||
|
PYTHONBN(reload);
|
||||||
|
PYTHONBN(repr);
|
||||||
|
PYTHONBN(round);
|
||||||
|
PYTHONBN(setattr);
|
||||||
|
PYTHONBN(slice);
|
||||||
|
PYTHONBN(str);
|
||||||
|
PYTHONBN(tuple);
|
||||||
PYTHONBN(type);
|
PYTHONBN(type);
|
||||||
|
PYTHONBN(vars);
|
||||||
|
PYTHONBN(xrange);
|
||||||
|
PYTHONBN(zip);
|
||||||
|
|
||||||
/* Boolean type */
|
|
||||||
|
/*
|
||||||
|
built-in names
|
||||||
|
boolean type and None
|
||||||
|
*/
|
||||||
PYTHONBN(True);
|
PYTHONBN(True);
|
||||||
PYTHONBN(False);
|
PYTHONBN(False);
|
||||||
|
PYTHONBN(None);
|
||||||
|
|
||||||
|
|
||||||
#undef PYTHONBN
|
#undef PYTHONBN
|
||||||
|
#undef PYTHONKW
|
||||||
|
|
||||||
#endif //__python_pythonkw_swg__
|
#endif //__python_pythonkw_swg__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue