AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

Add .none(false) for arguments of python exposed functions expecting strings

Open
#1,202 8 comments 0 reactions 0 assignees View on GitHub
good first issue help wanted
Dominant language
C++
Stars
2.1k
Forks
503
PR merge metrics
No merged PRs in 30d

Description

Several API functions are taking const char * parameters. They are often exposed to Python with:
.def("function", &Class::function, "parameter"_a)
This is working fine, when used in python, the parameter type is checked, but when used with None a segfault occurs.
To handle that .none(false) can be added to the parameter:
.def("function", &Class::function, "parameter"_a.none(false))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.