diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2020-01-03 12:11:56 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2020-01-06 14:42:33 -0800 |
commit | f56abc714b461e79c01ceb8f90ad9403109a8e4e (patch) | |
tree | 757c071614e3030e944c4ea3d29d396eba563927 /host/lib/rfnoc | |
parent | 9ca8504f8e3d3f050093c96f824ffb000d9897f7 (diff) | |
download | uhd-f56abc714b461e79c01ceb8f90ad9403109a8e4e.tar.gz uhd-f56abc714b461e79c01ceb8f90ad9403109a8e4e.tar.bz2 uhd-f56abc714b461e79c01ceb8f90ad9403109a8e4e.zip |
python: rfnoc: make block_id_t more compatible with strings
Allows the RFNoC Python API to automatically convert strings to
block_id_t's.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/rfnoc_python.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/host/lib/rfnoc/rfnoc_python.hpp b/host/lib/rfnoc/rfnoc_python.hpp index 32bc8d03a..d3a5734a3 100644 --- a/host/lib/rfnoc/rfnoc_python.hpp +++ b/host/lib/rfnoc/rfnoc_python.hpp @@ -100,6 +100,9 @@ void export_rfnoc(py::module& m) .def(py::self < py::self) .def(py::self > py::self) .def(py::self == std::string()); + // This will allow functions in Python that take a block_id to also take + // a string: + py::implicitly_convertible<std::string, block_id_t>(); py::enum_<graph_edge_t::edge_t>(m, "edge") .value("static", graph_edge_t::STATIC) |