diff --git a/src/arrays.sip b/src/arrays.sip index 0c24cdcd..1213b327 100644 --- a/src/arrays.sip +++ b/src/arrays.sip @@ -13,44 +13,39 @@ // Some SIP MappedTypes that automatically convert Python lists of // strings/ints to and from wxArrayString/wxArrayInt. +// TODO: SWitch to iterator protocol APIs + //-------------------------------------------------------------------------- %MappedType wxArrayString { %ConvertToTypeCode // Code to test a PyObject for compatibility + // Verify that the object is a sequence, but not bytes or unicode if (!sipIsErr) { - int success = TRUE; - // ensure that it is a sequence - if (! PySequence_Check(sipPy)) - success = FALSE; - // Ensure it is not a string or unicode object (they are sequences) - else if (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy)) - success = FALSE; - // ensure each item is a string/unicode object - else { - Py_ssize_t i, len = PySequence_Length(sipPy); - for (i=0; iAdd(wxPyInt_AS_LONG(number)); Py_DECREF(item); Py_DECREF(number); @@ -190,26 +182,8 @@ wxArrayInt testArrayIntTypemap(const wxArrayInt& arr); %ConvertToTypeCode // Code to test a PyObject for compatibility if (!sipIsErr) { - int success = TRUE; - // ensure that it is a sequence - if (! PySequence_Check(sipPy)) - success = FALSE; - // ensure each item is a number object - else { - Py_ssize_t i, len = PySequence_Length(sipPy); - for (i=0; iAdd(PyFloat_AS_DOUBLE(number)); Py_DECREF(item); Py_DECREF(number); diff --git a/src/string.sip b/src/string.sip index 2773486c..ae9bbed3 100644 --- a/src/string.sip +++ b/src/string.sip @@ -24,7 +24,7 @@ %ConvertToTypeCode #if wxUSE_UNICODE_WCHAR == 0 - #error wxString converison can only handle WCHAR wxStrings currently + #error wxString conversion can only handle WCHAR wxStrings currently #endif // Code to test a PyObject for compatibility with wxString