From f56abc714b461e79c01ceb8f90ad9403109a8e4e Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Fri, 3 Jan 2020 12:11:56 -0800 Subject: python: rfnoc: make block_id_t more compatible with strings Allows the RFNoC Python API to automatically convert strings to block_id_t's. --- host/lib/rfnoc/rfnoc_python.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'host/lib/rfnoc') 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(); py::enum_(m, "edge") .value("static", graph_edge_t::STATIC) -- cgit v1.2.3