Add %pythonbegin directive.

For adding code at the beginning of the generated .py file.
This commit is contained in:
William S Fulton 2013-07-05 06:30:16 +01:00
commit d0af4f50d3
5 changed files with 71 additions and 3 deletions

View file

@ -5,6 +5,16 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.11 (in progress)
============================
2013-07-05: wsfulton
[Python] Add %pythonbegin directive which works like %pythoncode, except the specified code is
added at the beginning of the generated .py file. This is primarily needed for importing from
__future__ statements required to be at the very beginning of the file. Example:
%pythonbegin %{
from __future__ import print_function
print("Loading", "Whizz", "Bang", sep=' ... ')
%}
2013-07-01: wsfulton
[Python] Apply SF patch #340 - Uninitialized variable fix in SWIG_Python_NonDynamicSetAttr
when using -builtin.