-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Added cmake switch to enable limited python API (stage 3) #14736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5f7548a
to
f4093d0
Compare
static PyObject* pyopencv_##NAME##_repr(PyObject* self) \ | ||
{ \ | ||
char str[1000]; \ | ||
sprintf(str, "<"#NAME" %p>", self); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snprintf with sizeof(str)
// Debug module load: | ||
// | ||
// else \ | ||
// { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code?
@@ -741,16 +679,18 @@ PyObject* pyopencv_from(const String& value) | |||
} | |||
|
|||
template<> | |||
bool pyopencv_to(PyObject* obj, String& value, const char* name) | |||
bool pyopencv_to(PyObject* obj, String &value, const char* name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, What coding style binds reference &
symbol to variable name instead of type? In case of return value type?
|
||
gen_template_check_self_algo = Template(""" $cname* _self_ = NULL; | ||
if(PyObject_TypeCheck(self, &pyopencv_${name}_Type)) | ||
_self_ = dynamic_cast<$cname*>(${amp}((pyopencv_${name}_t*)self)->v.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does TypeCheck()
allows to drop dynamic_cast
completely?
{ | ||
dst = ((pyopencv_${name}_t*)src)->v.dynamicCast<${cname}>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same note about dynamic_cast
5928488
to
10d61a2
Compare
Supersedes #14428 and #14120
This pullrequest changes
cmake option "PYTHON3_LIMITED_API" will enable limited API
Details: PEP-0384