swig/Doc
William S Fulton 3159de3e9f Add support for Python variable annotations as a feature.
Both function annotations and variable annotations are turned on using the
"python:annotations" feature. Example:

  %feature("python:annotations", "c");

  struct V {
    float val;
  };

The generated code contains a variable annotation containing the C float type:

  class V(object):
      val: "float" = property(_example.V_val_get, _example.V_val_set)
      ...

Python 3.5 and earlier do not support variable annotations, so variable
annotations can be turned off with a "python:annotations:novar" feature flag.
Example turning on function annotations but not variable annotations globally:

  %feature("python:annotations", "c");
  %feature("python:annotations:novar");

or via the command line:

  -features python:annotations=c,python:annotations:novar

Closes #1951
2022-03-02 19:33:03 +00:00
..
Devel Fix typos in docs and comments 2022-02-27 18:15:46 +13:00
Manual Add support for Python variable annotations as a feature. 2022-03-02 19:33:03 +00:00
README suggest starting points for documentation 2008-10-09 22:42:45 +00:00

Doc/Manual    -  Latest version of the SWIG user manual
Doc/Devel     -  Developer documentation concerning SWIG internals.
                 (not necessarily up to date)

Open the index.html file in each of these directories with a web browser.