A slew of changes based on William Fulton's code review.

- Fixed naming conventions; SwigPyBuiltin is used a lot
- Removed use of std::vector
- builtin.swg isn't included if -builtin isn't specified
- Changed many feature names to use a "python:" prefix
- Eliminated static vars in std_pair.i
- Eliminated C++-style comments (//)
- Enabled autodoc and docstring with -builtin
- Fixed non-ansi generated C code
- Detect and complain if two incompatible swig modules are loaded
- Removed argcargvtest_runme3.py, and fixed argcargvtest_runme.py
  so that 2to3 handles it better
- Removed anonymous namespaces
- Eliminated builtin_init typemaps; consolidated functionality into
  SWIG_Python_NewPointerObj
- Eliminate printf warnings from %U conversion character by switching
  to %S, which works just as well
- Fixed li_std_set_runme.py for python3, which returns set members in
  a different order from python2





git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Stefan Zager 2011-03-29 06:57:02 +00:00
commit 3d444101d1
23 changed files with 550 additions and 509 deletions

View file

@ -47,7 +47,7 @@
static PyObject *from(const map_type& map) {
swig_type_info *desc = swig::type_info<map_type>();
if (desc && desc->clientdata) {
return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
return SWIG_InternalNewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
} else {
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
size_type size = map.size();
@ -127,7 +127,7 @@
if (!seq)
return SWIG_Py_Void();
SwigPyIterator *iter = make_output_key_iterator(seq->begin(), seq->begin(), seq->end(), pyself);
return SWIG_NewPointerObj(iter, SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN);
return SWIG_InternalNewPointerObj(iter, SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN);
}
template<class OutIterator,
@ -156,9 +156,9 @@
%swig_container_methods(Map)
#if defined(SWIGPYTHON_BUILTIN)
%feature("pyslot", "mp_length", functype="lenfunc") __len__;
%feature("pyslot", "mp_subscript", functype="binaryfunc") __getitem__;
%feature("pyslot", "tp_iter", functype="getiterfunc") key_iterator;
%feature("python:slot", "mp_length", functype="lenfunc") __len__;
%feature("python:slot", "mp_subscript", functype="binaryfunc") __getitem__;
%feature("python:slot", "tp_iter", functype="getiterfunc") key_iterator;
%extend {
%newobject iterkeys(PyObject **PYTHON_SELF);
@ -287,7 +287,7 @@
%swig_map_common(Map)
#if defined(SWIGPYTHON_BUILTIN)
%feature("pyslot", "mp_ass_subscript", functype="objobjargproc") __setitem__;
%feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__;
#endif
%extend {