These are not working yet for all combinations of builtin and PY3
The goal is to have a sensible default error that states that
pickling is not supported.
The metaclass (SwigPyObjectType) for SWIG objects was not defined in
a way that let importlib successfully import the Python wrappers.
The pickle module failed because it couldn't determine what module the
SWIG wrapped objects are in.
I've changed the definition of SwigPyObjectType using more normal
builtin type definitions. There are still some open questions:
- None of the builtin types, like swig_static_var_getset_descriptor and
SwigPyObject are added into any module. No call to PyModule_AddObject
is made, so isinstance cannot be used for any wrapped type, all of
which are derived from SwigPyObject.
Closes#808
* [Go] Fix argument names in inherited functions #795
This commit fixes a wrong argument name replacement in the inherited functions as well as a memory leak.
* Add testcase for #795
* Move variable_replacement testcase into common
* Move variable_replacement testcase into common
The closure names used for builtin slots are mangled with their functype so
that overloaded C++ method names can be used for multiple slots.
For example:
%feature("python:slot", "mp_subscript", functype="binaryfunc") SimpleArray::__getitem__;
%feature("python:slot", "sq_item", functype="ssizeargfunc") SimpleArray::__getitem__(Py_ssize_t n);
will generate closures:
SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___ssizeargfunc_closure */
SWIGPY_BINARYFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___binaryfunc_closure */
Previously the return value of call_user_function() was ignored and we
checked an uninitialised value instead. Fixes#627. Based on patch
from Sergey Seroshtan.
The existing typemap was just broken - it correctly created the resource
and then did nothing with it, and instead tried to register the member
pointer as a normal pointer, which is never going to work as it's larger
than a normal pointer.
Add cpp_basic_runme.php as a regression test for this.
Default hash is the underlying C/C++ pointer.
This matches up with testing for equivalence (Py_EQ in SwigPyObject_richcompare)
which compares the pointers.
If the wrong return type in the hash function was used, an error:
SystemError: error return without exception set
was raised
Add some tests for testing builtin slots
* stl-vector-ptrs:
Test case warning fixes for nodejs
Fix testcase causing nodejs test failure
UTL STL container descriptor checks
Fix std::vector of pointers which failed if a pointer to a pointer of the container element type existed (Python)
Remove unused traits.swg
* wkalinin-nested-ignore-fix:
renamed test module, in accordance with other tests
function body fixed
added foo() definition to satisfy some test linking fails
func() renamed to foo() for 'go'
fixed test-suite/nested_ignore.i
test for #662
fix for nested ignored types
Closes#662
Also fixes -O.
This is a minimal change avoiding the differences in the function names
when -fastproxy is used until autodoc code is improved with doxygen
changes.
Closes#721.
Testcase has now been modified to mask the problem by providing the default parameter 'int' in:
%shared_ptr(Space::BaseDefault<short, int>)
If this is not done then d fails to convert to BaseDefault<short>&
This needs fixing in SWIG, but the problem is masked for now, so that the python
testcase works when run with the -O option.
Fixes SF bug 3333549 - %shared_ptr fixes when the type is a template using
template parameters that are typedef'd to another type.
Also fixes python -O optimization where the smart pointer conversion to the
base class needs to work because of the virtual methods that have been
optimized away.
* mromberg-relative:
Python: Do not import all of sys when using -relativeimport
Add missing print statements to the Python import_packages tests
Update -relative import documentation to reflect runtime check.
> to >=
Make the check for python3 -relative does python runtime check.