aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2020-01-03 12:11:56 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2020-01-06 14:42:33 -0800
commitf56abc714b461e79c01ceb8f90ad9403109a8e4e (patch)
tree757c071614e3030e944c4ea3d29d396eba563927
parentmpm: include the failed mpm_shell command (diff)
downloaduhd-f56abc714b461e79c01ceb8f90ad9403109a8e4e.tar.xz
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.
-rw-r--r--host/lib/rfnoc/rfnoc_python.hpp3
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)