From 2ea04bf544cf30220bff8b5bbaafa81a9db41183 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 26 Nov 2020 10:04:44 +0100 Subject: python: Make TuneRequest implicitly convertible from double This allows to do the following: >>> usrp = uhd.usrp.MultiUSRP(args) >>> usrp.set_tx_frequency(1e9) In the past, you would have to manually convert the frequency to a uhd.types.TuneRequest before passing it to set_?x_frequency(). This new behaviour makes Python match the C++ behaviour. --- host/lib/types/tune_python.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'host') diff --git a/host/lib/types/tune_python.hpp b/host/lib/types/tune_python.hpp index 75455e3d8..842e9b124 100644 --- a/host/lib/types/tune_python.hpp +++ b/host/lib/types/tune_python.hpp @@ -31,6 +31,7 @@ void export_tune(py::module& m) .def_readwrite("rf_freq", &tune_request_t::rf_freq) .def_readwrite("dsp_freq", &tune_request_t::dsp_freq) .def_readwrite("args", &tune_request_t::args); + py::implicitly_convertible(); py::class_(m, "tune_result") .def(py::init<>()) -- cgit v1.2.3