diff options
author | Kris Thielemans <kris.f.thielemans@gmail.com> | 2013-08-07 19:22:10 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-08-07 20:22:03 +0100 |
commit | a495b5a985ca54033cfea6719d4d838c85b9c2aa (patch) | |
tree | 76ebbeb380f830adb5ff4f3b3325e833d2c8e289 /CHANGES.current | |
parent | a0af86811dc8835a16c71a1ef78c7a4294438326 (diff) | |
download | swig-a495b5a985ca54033cfea6719d4d838c85b9c2aa.tar.gz |
Remove SwigPyObject_print and SwigPyObject_str, and make the generated wrapper use the default python implementations, which will fall back to repr (for -builtin option).
Advantages:
- it avoids the swig user having to jump through hoops to get print to
work as expected when redefining repr/str slots.
- typing the name of a variable on the python prompt now prints the
result of a (possibly redefined) repr, without the swig user having to
do any extra work.
- when redefining repr, the swig user doesn't necessarily have to
redefine str as it will call the redefined repr
- the behaviour is exactly the same as without the -builtin option while
requiring no extra work by the user (aside from adding the
%feature("python:slot...) statements of course)
- the patch simplifies pyrun.swg a tiny bit.
Disadvantage:
- default str() will give different (but clearer?) output on swigged
classes compared to unpatched swig
SF Bug #326
Diffstat (limited to 'CHANGES.current')
-rw-r--r-- | CHANGES.current | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CHANGES.current b/CHANGES.current index b03e05ffc..cc2ce897d 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -4,6 +4,25 @@ See the RELEASENOTES file for a summary of changes in each release. Version 2.0.11 (in progress) ============================ + +2013-08-07: wsfulton + [Python] SF Patch #326 from Kris Thielemans - Remove SwigPyObject_print and SwigPyObject_str and + make the generated wrapper use the default python implementations, which will fall back to repr + (for -builtin option). + + Advantages: + - it avoids the swig user having to jump through hoops to get print to work as expected when + redefining repr/str slots. + - typing the name of a variable on the python prompt now prints the result of a (possibly redefined) + repr, without the swig user having to do any extra work. + - when redefining repr, the swig user doesn't necessarily have to redefine str as it will call the + redefined repr + - the behaviour is exactly the same as without the -builtin option while requiring no extra work + by the user (aside from adding the %feature("python:slot...) statements of course) + + Disadvantage: + - default str() will give different (but clearer?) output on swigged classes + 2013-07-30: wsfulton [Python, Ruby] Fix #64 #65: Missing code in std::multimap wrappers. Previously an instantiation of a std::map was erroneously required in addition to an instantiation of std::multimap with the |