Python and static class methods
Jim Easterbrook <[email protected]> Fri, 24 Sep 2021 12:42:51 +0100
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <[email protected]> |
In the documentation (http://www.swig.org/Doc4.0/Python.html#Python_nn20 ) it says "Prior to Python-2.2, Python classes had no support for static methods". The example it shows has several ways to access the static member: >>> example.Spam_foo() # Spam::foo() >>> s = example.Spam() >>> s.foo() # Spam::foo() via an instance >>> example.Spam.foo() # Spam::foo(). Python-2.2 only Python 2.2 was a long time ago, and I'd like to exclude the example.Spam_foo version from my Python interfaces. It's not needed and isn't what users familiar with the C++ library being wrapped are familiar with. (And the last line in the example should say "Python-2.2 onwards".) Is there a way to suppress the generation of example.Spam_foo? -- Jim Easterbrook <http://www.jim-easterbrook.me.uk/>