Commit Graph

8 Commits

Author SHA1 Message Date
Olly Betts 56f82e5541 Remove obsolete debug line from callback_runme.py
We stopped wrapping C++ static method A::bar as A_bar in SWIG 4.1.0.
2023-05-17 13:38:04 +12:00
William S Fulton 2272d00c1a Add Python testcase for testing flatstaticmethod syntax
For testing legacy flattened static method access for when
issue #2137 is applied.
2022-01-15 00:05:06 +00:00
William S Fulton 3aa302c08f %callback and Python class access for C++ static member functions fixes
Fix access to C++ static member functions using Python class
staticmethod syntax, such as Klass.memberfunction instead of
Klass_memberfunction, when using -fastproxy and -builtin in
combination with %callback.

The docstring containing the callback pointers were not being patched
during module initialisation.
2022-01-14 23:00:59 +00:00
William S Fulton 1bd1142d02 Fix python callback test-suite failure 2019-01-16 20:10:37 +00:00
William S Fulton cf1624ebc4 Python static method wrapper changes
- Static method wrappers were using the 'fastproxy' approach by default.
  This is inconsistent with instance method wrappers. The fastproxy approach
  is now turned off by default to be consistent with instance methods.
  Static method wrappers can now also be controlled using the -fastproxy and
  -olddefs options.

  Example:

    struct Klass {
      static int statmethod(int a = 2);
    };

  generates:

  class Klass(object):
      ...
      @staticmethod
      def statmethod(a=2):
          return _example.Klass_statmethod(a)

  instead of:

    class Klass(object):
      ...
      statmethod = staticmethod(_example.Klass_statmethod)

- Modernise wrappers for static methods to use decorator syntax - @staticmethod.

- Add missing runtime test for static class methods and using the actual
  class method.
2019-01-16 08:21:00 +00:00
Jon Schlueter b77f3afafb autopep8 cleanup of Examples/test-suite/python
automated cleanup of python pep8 whitespace compliance
2015-05-08 21:35:52 -04:00
Marcelo Matus 26d42ec95d fixes for python 2.1
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-23 09:08:49 +00:00
Marcelo Matus 8cd612c7c1 add callback and inout tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6281 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-02 01:33:38 +00:00