diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-10-23 17:49:58 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-10-23 17:49:58 -0300 |
commit | 30d47b496fac7fc98a2b249746057a2fb9636e2b (patch) | |
tree | 1eda261d040e3a52e4f5f3ba8f542217fa67e1f9 /tests | |
parent | 76892dffe7e79d45f9300ac496baec5063aa72fe (diff) |
changed the way that added special methods ("__str__", "__repr__") are
dealt with to allow future expansions ("__call__", "__getattr__", etc)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 363abb560..7461ce2c0 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -218,6 +218,12 @@ %0 = PyString_FromFormat("Point(%d, %d)", (int) %CPPSELF.x(), (int) %CPPSELF.y()); </inject-code> </add-function> + <add-function signature="__repr__()" return-type="PyObject*"> + <inject-code class="target" position="beginning"> + %0 = PyString_FromFormat("<Point object at %p: (%d, %d)>", + %CPPSELF, (int) %CPPSELF.x(), (int) %CPPSELF.y()); + </inject-code> + </add-function> </value-type> <value-type name="Size"/> <value-type name="MapUser"/> |