aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/oddbool_conversions.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-10-26 19:43:43 -0200
committerHugo Lima <hugo.lima@openbossa.org>2009-10-27 11:37:26 -0200
commit46619953316a8bc7b5cfc5ac5536187658069273 (patch)
tree5313b0fd05e5a42e883aac5a0b9aaca7c5f145a8 /tests/samplebinding/oddbool_conversions.h
parente7e527ad998fa9c2dbb7d8bf93d105e7b916e755 (diff)
Added Converter<T>::isConvertible to replace the T_Check functions.
This allow the user to full custommize the type conversion. Note: This change added a known regression on test_derived
Diffstat (limited to 'tests/samplebinding/oddbool_conversions.h')
-rw-r--r--tests/samplebinding/oddbool_conversions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/samplebinding/oddbool_conversions.h b/tests/samplebinding/oddbool_conversions.h
index 2e3f26414..7507cb52b 100644
--- a/tests/samplebinding/oddbool_conversions.h
+++ b/tests/samplebinding/oddbool_conversions.h
@@ -1,6 +1,11 @@
template <>
struct Converter<OddBool>
{
+ static bool isConvertible(const PyObject* pyObj)
+ {
+ return PyBool_Check(pyObj);
+ }
+
static PyObject* toPython(OddBool holder)
{
return PyBool_FromLong(holder.value());