Commit graph

161 commits

Author SHA1 Message Date
William S Fulton
066c396ad6 Add C++17 documentation chapter 2018-05-14 21:29:46 +01:00
William S Fulton
b0e29fbdf3 Add missing checks for failures in calls to PyUnicode_AsUTF8String.
Previously a seg fault could occur when passing invalid UTF8 strings (low
surrogates), eg passing u"\udcff" to the C layer (Python 3).
2017-12-04 20:14:04 +00:00
William S Fulton
32a454cfef Merge branch 'templates-scope-enforcement'
* templates-scope-enforcement:
  Test a few %template errors
  Add using declarations to templates into typedef table.
  Fix type lookup in the presence of using directives and using declarations
  More docs on %template
  Testcase fix for nameclash in php
  %template scope enforcement and class definition fixes
  Template documentation tweaks
  More consistent formatting of examples in documentation
  More consistent formatting of examples in documentation
  Documentation corrections to use targetlang formatting
  More consistent formatting of examples in documentation
  More consistent formatting of examples in documentation
  More consistent formatting of examples in documentation
  Namespace documentation minor corrections
  Improve description of template_parameters_resolve
  Minor code optimisation in template_parameters_resolve
  Fix scope lookup for template parameters containing unary scope operators
  Typemap change for templates
2017-08-16 21:44:51 +01:00
William S Fulton
5779aa8d79 More consistent formatting of examples in documentation 2017-08-16 00:24:25 +01:00
William S Fulton
04131a988f More consistent formatting of examples in documentation 2017-08-16 00:24:25 +01:00
William S Fulton
7ee76f93f9 More consistent formatting of examples in documentation 2017-08-16 00:24:25 +01:00
Olly Betts
90f9117e10 Fix various comment and documentation typos 2017-08-13 18:04:33 +12:00
William S Fulton
687cf9c9c1 Add missing %python:maybecall to operator overloads.
This ensures NotImplemented is returned on error so that the Python
interpreter will handle the operators correctly instead of throwing an
exception. NotImplemented was not being returned for non-builtin wrappers
when the operator overload did not have a function overload.

See PEP 207 and https://docs.python.org/3/library/constants.html#NotImplemented

Mentioned in SF patch #303 and SF bug #1208.
2017-06-19 19:25:27 +01:00
Julien Schueller
7350e9fffa Typo in Python.html 2017-03-24 14:22:53 +01:00
William S Fulton
f0f2fd2dae Merge branch 'tleonhardt-python_threads'
* tleonhardt-python_threads:
  Style fixes for Python threads documentation changes
  Finished updating Python docs for -threads option
  Started making changes to Python.html to document support for multithreaded Python SWIG applications.
2017-03-24 08:22:51 +00:00
William S Fulton
d888fabc0c Style fixes for Python threads documentation changes 2017-03-24 08:22:16 +00:00
William S Fulton
da381668a2 Python doc correction for %pybuffer_mutable_string usage
[skip ci]
2017-03-17 19:02:38 +00:00
Todd Leonhardt
bcf8d927f0 Finished updating Python docs for -threads option 2017-03-01 17:51:47 -05:00
Todd Leonhardt
52d12bc415 Started making changes to Python.html to document support for multithreaded Python SWIG applications. 2017-02-28 20:53:30 -05:00
William S Fulton
92d694225a Update wiki links to new Github wiki site
[skip ci]
2017-01-05 18:39:57 +00:00
sunoru
8985c34809 Fix some typos in docs and examples and make the code look nicer. 2016-12-31 23:06:56 +08:00
William S Fulton
2a42031b08 Custom Python module importing code
Add optional moduleimport attribute to %module so that the
default module import code can be overridden. See the
"Searching for the wrapper module" documentation in Python.html.
Example:

  %module(moduleimport="import _foo") foo

$module also expands to the low-level C/C++ module name, so
the following is the same as above

  %module(moduleimport="import $module") foo

Issue https://github.com/swig/swig/issues/769
2016-12-01 18:59:33 +00:00
William S Fulton
96015de0dd Update documentation for using SWIG_ConvertPtr example usage
Add a test case to test the example documentation typemaps
2016-10-23 20:16:35 +01:00
William S Fulton
268b942865 Consistent formatting of example code in the docs 2016-10-23 20:16:35 +01:00
William S Fulton
129ef8ea8f Correct docs and examples to call SWIG_fail after setting a Python error
Although 'return NULL' works, it may miss out on some cleanup and NULL
is the wrong value to return in generated code for overloaded functions.
2016-10-23 20:16:35 +01:00
William S Fulton
4f681f751d Update Python docs on builtin slots 2016-08-18 07:11:00 +01:00
William S Fulton
64f5d23b13 Python docs on static linking section edits 2016-06-12 00:13:07 +01:00
Mike Romberg
2bb732008a Add more documentation about statically linked python modules. 2016-06-11 16:08:24 -06:00
William S Fulton
d18b6e2c8d Python module loading documentation tweaks 2016-06-11 00:59:00 +01:00
Mike Romberg
7b1b2e177f Add documentation about how foo.py finds/loads _foo for python. 2016-06-07 15:28:40 -06:00
William S Fulton
81adedd7dd Python: Do not import all of sys when using -relativeimport 2016-06-06 22:20:07 +01:00
Mike Romberg
ac7157dfc6 Update -relative import documentation to reflect runtime check. 2016-06-06 13:43:58 -06:00
William S Fulton
d01efd82e1 Merge branch 'mromberg-implpkg'
* mromberg-implpkg:
  Minor edits to Python implicit namespace package docs
  use %inline for test
  use relative import for -builtin and python2
  Python3 removes support for relative imports
  Document implicit namespace packages for python
  disable namespace package build
  Attempt to calm the testing gods...
  use whatever name winders uses for .so files.
  Examples (and tests) for python namespace packages
  disable namespace package build
  spelling
  Attempt to calm the testing gods...
  use whatever name winders uses for .so files.
  Don't run example for old pythons
  Examples (and tests) for python namespace packages
  use importlib to load C extension modules for python 2.7 and newer
2016-05-24 22:48:37 +01:00
William S Fulton
4253740d40 Minor edits to Python implicit namespace package docs 2016-05-24 22:46:46 +01:00
William S Fulton
bf24c11645 Correct default arg link in Python docs
[skip ci]
2016-05-06 07:36:53 +01:00
William S Fulton
a8110e3761 Correct Python docs example
Fix PyTuple_SetItem in argout typemap
Fix from Bob Hood on swig-user mailing list
[skip ci]
2016-04-30 12:58:22 +01:00
Mike Romberg
cd2c7b9245 Document implicit namespace packages for python 2016-04-05 11:10:04 -06:00
William S Fulton
80e3ebf0d1 html doc fixes 2016-04-02 13:47:23 +01:00
William S Fulton
355f2623c7 Improve documentation for multi-argument typemaps and overloading 2016-04-02 13:44:44 +01:00
Olly Betts
4e9203acc3 Eliminate doc reference to Python 1.4 2016-02-17 14:18:21 +13:00
Alec Cooper
ba40c4a256 Documentation on Python Bytes/Unicode distinction 2016-02-04 21:07:40 -05:00
Olly Betts
72691e5a49 Clean up Python embed.i
Remove duplicate (aside from comment formatting) embed15.i.

Remove references to Python 1.5.

Tested and remarkably still works with Python 2.7, so update
documentation and comments to reflect that.
2016-01-27 19:01:49 +13:00
William S Fulton
3763beb489 Replace tabs with spaces in html docs
wkhtmltopdf is not expanding tabs within <pre> elements to 8 spaces as it
should. Workaround the problem by converting all tabs to an appropriate
number of spaces.
2015-12-30 22:22:33 +00:00
William S Fulton
925b2a336f HTML fixes for documentation - add meta tag and loose.dtd 2015-12-30 22:22:32 +00:00
William S Fulton
8288ac15a0 Correct links in html documentation using new version of makechap.py
Corrects position of heading text within A and H1, H2, ... elements.
2015-12-30 22:22:32 +00:00
William S Fulton
01611702ec Python 2 Unicode strings can be used as inputs to char * or std::string types
Requires SWIG_PYTHON_2_UNICODE to be defined when compiling generated code.
2015-12-19 03:55:26 +00:00
William S Fulton
0ae5bfa6e2 html links updates 2015-12-18 21:14:44 +00:00
William S Fulton
51ee23b580 Link to distutils fix 2015-12-05 19:25:18 +00:00
William S Fulton
803ba97a83 Update docs for shared_ptr 2015-10-01 22:36:01 +01:00
xantares
92328a2016 pep257 & numpydoc conforming docstrings 2015-08-07 22:15:13 +01:00
William S Fulton
3b859ab539 Html doc fixes 2015-07-05 17:16:37 +01:00
Olly Betts
8208d12aa5 Document use of %pythoncode "file.py"
As discussed in github issue #379.
2015-06-29 22:24:59 +12:00
William S Fulton
b8e1a66a38 Add new feature "python:cdefaultargs"
Controls default argument code generation to obtain the default
arguments from the C++ layer instead of the Python layer.
2015-05-28 20:11:57 +01:00
Olly Betts
af113fa6f0 Add missing ; after C++ class definitions 2015-03-20 13:46:28 +13:00
William S Fulton
7c2ed7eae5 Python html doc cosmetic tweaks
[skip ci]
2015-02-02 20:00:07 +00:00