Commit graph

20,780 commits

Author SHA1 Message Date
William S Fulton
edfbbab8e2 Merge branch 'python-options-rationalise'
* python-options-rationalise:
  Hard-wire -noproxydel on
  Hard-wire -modern and -modernargs on
  Drop support for Python classic classes
2018-10-12 07:13:12 +01:00
Olly Betts
4a48e59dc6 Hard-wire -noproxydel on
We only still default to generate a no-op __del__ method for theoretical
compatibility with old code, and 4.0.0 is a good time to make a cut-off
should such code really still exist.

On the flip-side, the presence of a __del__ method seems to be able to
prevent garbage collection from kicking in (see #1215), so it's
definitely desirable to get rid of it when there's nothing for it to do.

 Conflicts:
	Source/Modules/python.cxx

This is a cherry-pick and merge from the patch in #1261
2018-10-12 07:10:47 +01:00
Olly Betts
e4fceee12f Hard-wire -modern and -modernargs on
What SWIG calls "modern" classes are supported by Python 2.3 and up
which means they're supported by all the Python versions we aim to
support in 4.0.0.

 Conflicts:
	Source/Modules/python.cxx

This is a cherry-pick and merge from the patch in #1261
2018-10-12 07:10:47 +01:00
Olly Betts
728b8955bd Drop support for Python classic classes
There were only needed to support Python < 2.2, and we now require at
least Python 2.6.

 Conflicts:
	.travis.yml
	Examples/test-suite/python/autodoc_runme.py
	Source/Modules/python.cxx

This is a cherry-pick and merge from patch in #1261
2018-10-12 07:10:47 +01:00
William S Fulton
e3a55562cc
Merge pull request #1333 from jschueller/patch-1
[Python] Fix -Wstringop-overflow warning
2018-10-10 00:04:27 +01:00
William S Fulton
dcbccc6f6f Test non-default compare template argument in std::map 2018-10-09 22:43:19 +01:00
William S Fulton
967776189e Add support for non-default compare template argument in std::map wrappers - Javascript 2018-10-09 22:42:49 +01:00
William S Fulton
c8fc6a0322 Fix guile std::map bug in out typemap 2018-10-09 19:46:27 +01:00
William S Fulton
ca287ae13b Add support for non-default compare template argument in std::map wrappers 2018-10-09 19:44:00 +01:00
William S Fulton
220a735ec5 Update php test 2018-10-09 19:37:07 +01:00
William S Fulton
8ddf24881a Merge branch 'vadz-java-map-comp'
* vadz-java-map-comp:
  Add support for std::map<> comparator template argument for Java

Conflicts:
	CHANGES.current
2018-10-09 07:09:06 +01:00
William S Fulton
51f1478df7 Improve typemaps documentation for %apply and delete.
Make %apply and %clear section clearer (hopefully).
2018-10-05 20:45:52 +01:00
William S Fulton
84f7b740ea Fix testcase for visual studio (2) 2018-10-05 06:52:49 +01:00
William S Fulton
94377ef3ed Fix testcase for visual studio 2018-10-04 19:09:11 +01:00
William S Fulton
18383340e9 Fix C default arguments with -builtin and -fastunpack and -modernargs.
Problem occurred when there is just one (defaulted) parameter in the parameter list.

Closes #1126
2018-10-04 08:06:01 +01:00
Julien Schueller
c0c2d90497
[Python] Fix -Wstringop-overflow warning
fixes #1332
2018-10-01 09:31:42 +02:00
William S Fulton
142d4062df Fix invalid free in SWIG_Python_AddErrMesg
Closes #1331
2018-09-28 07:08:12 +01:00
William S Fulton
b90e3ae35d C# directors override/virtual - additional testing
Add runtime test for scenario described in #1323.
Expand testing to cover a mix of override/virtual method overloading.
Remove testSwigDerivedClassHasMethod() test - not fixed yet.
2018-09-25 19:40:35 +01:00
Rokas Kupstys
e4a251f321 Add new keywords for non-verriding methods in director_basic test. 2018-09-25 19:39:53 +01:00
Rokas Kupstys
ea3140a981 Improve correctness of SwigDerivedClassHasMethod() tests
Tests first added in issue #1323
2018-09-25 19:39:02 +01:00
William S Fulton
7eba1cfea1 Testcase code correction 2018-09-24 07:15:59 +01:00
William S Fulton
3872890c1c Add changes file entry for Python hash table implementation 2018-09-24 07:07:25 +01:00
William S Fulton
d30effd886 Python builtin closure minor tweaks 2018-09-23 19:20:22 +01:00
William S Fulton
631e26ae48 Python std::unordered_set tidy up and additional testing 2018-09-23 19:10:26 +01:00
William S Fulton
72ccea5080 Python std::unordered_map std::unordered_multimap improvements
- Fixes for -builtin
- Fix missing iterator support
2018-09-23 19:10:00 +01:00
William S Fulton
603285ecb6 Python std::unordered_map improvements
Pick up various bug fixes and improvements from the std::map
implementation.
2018-09-23 19:09:59 +01:00
William S Fulton
146998ce81 Python builtin - add indexing support to std::unordered_set 2018-09-23 19:09:59 +01:00
William S Fulton
05d6717de9 Python builtin - add indexing support to std::set 2018-09-23 19:09:54 +01:00
William S Fulton
4715a4e72c Python -builtin __contains__ fix for map and set like containers.
Fix when using -builtin and wrapping std::map, std::set, std::unordered_map or
std::unordered_set to ensure __contains__ is called. This is a wrapper for the STL
container's find method. Without it, Python will do its own slower sequence search.
2018-09-21 08:51:22 +01:00
William S Fulton
333209595d Python builtin test fix for non-builtin 2018-09-19 23:33:16 +01:00
luz.paz
ed28e7cbe2 Misc. typo and whitespace fixes
Found via `codespell -q 3 -L "uint,bae,objext,cmo,goin,struc,ois,upto"`
whitespaces were unintentionally fixed due to my editors settings.

Rebased patch #1327
2018-09-19 20:29:14 +01:00
William S Fulton
ad7b591d24 Add python -builtin -O Travis testing 2018-09-19 20:21:23 +01:00
William S Fulton
c6547ac44e Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack. 2018-09-19 20:10:11 +01:00
William S Fulton
bf85b6f7a9 Add in an example/test for Python __pow__
- A test for the ternaryfunc builtin slot
- Example of how to wrap C++ class for Python's pow
2018-09-16 17:33:14 +01:00
William S Fulton
4d34d419b6 Disable nondynamic testcase for Python -builtin -O 2018-09-06 21:22:51 +01:00
William S Fulton
040683d1b3 Fix Python -builtin and -fastdispatch regression.
Generated code did not compile
2018-09-06 21:07:59 +01:00
William S Fulton
dca3b5ac20 Merge branch 'rokups-csharp-fix-name-collision'
* rokups-csharp-fix-name-collision:
  Fix class having method `Connect()` creating a name collision with `SwigDirectorConnect()`.
2018-09-06 19:03:39 +01:00
Rokas Kupstys
0a102e2846 Fix class having method Connect() creating a name collision with SwigDirectorConnect().
Issue is fixed by prepending director methods with `SwigDirectorMethod` instead of `SwigDirector`.
2018-09-06 12:43:51 +03:00
William S Fulton
de5a2c496b Python runtime test invalid sequence fix
Fixes:
  DeprecationWarning: invalid escape sequence \]
shown using debug build of python-3.7 interpreter.
2018-09-04 07:35:41 +01:00
William S Fulton
3af1b74e57 Python implicitconv assert fix using debug build of the Python interpreter
An error was not being set if an implicit conversion was attempted
calling an explicit constructor.

Fixes:
Fatal Python error: a function returned NULL without setting an error
SystemError: <built-in function new_A> returned NULL without setting an error

File "Examples/test-suite/python/implicittest.py", line 106 in __init_
2018-09-04 07:22:20 +01:00
Andreas Gaeer
0165180735 Fix assert in PyTuple_GET_SIZE
Occurs in debug interpreter builds of python-3.7 when calling tp_new in
a few testcases such as Examples/python/extend.

Closes #1321
2018-09-03 19:52:43 +01:00
William S Fulton
eda58ca308 Add changes entry for guile gc fix 2018-09-01 09:55:40 +01:00
William S Fulton
de7fa2c499 Merge branch 'ChristopherHogan-chogan/guile_gc'
* ChristopherHogan-chogan/guile_gc:
  Run garbage collection in test for guile >= 2.0.12
  Fix garbage collection for guile >= 2.0.12
2018-09-01 09:53:02 +01:00
William S Fulton
b3f736a9d1 Python typo fix 2018-08-31 20:30:35 +01:00
William S Fulton
2f31c3e94e Python C++11 hash tables compilation fixes
- std::unordered_map compilation fix when just using std_unordered_map.i standalone
- std::unordered_multimap compilation fix when just using std_unordered_multimap.i standalone
- Add in the standalone unordered STL test cases

Closes #1319
2018-08-31 20:26:46 +01:00
Chris Hogan
63b689d7cd Run garbage collection in test for guile >= 2.0.12 2018-08-22 08:39:50 -05:00
William S Fulton
c33f352069 python -> Python in html docs 2018-08-21 22:41:02 +01:00
William S Fulton
f7818d5ed3 Simplify nested testcase
Remove duplicate code (that just had shorter names for Scilab).
2018-08-20 19:28:29 +01:00
William S Fulton
3baf6e9f97 Merge branch 'wkalinin-duplicate-unions'
* wkalinin-duplicate-unions:
  Add testcase for nested C struct name conflict
  Nested structures in "C" mode symbol table fix
2018-08-20 19:22:31 +01:00
William S Fulton
c39a379942 Add testcase for nested C struct name conflict
Issue #1305
2018-08-20 19:21:14 +01:00