summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python
diff options
context:
space:
mode:
authorJacob Gilbert <mrjacobagilbert@gmail.com>2020-10-12 13:49:35 -0700
committermormj <34754695+mormj@users.noreply.github.com>2020-10-14 08:30:18 -0400
commit261af18477917882bb5519c288c1dfe3148ebc80 (patch)
tree5db46644d984b299aa772e0f6bfd497a680e4ece /gnuradio-runtime/python
parentddcaab0f6196249e26fdfc4e32a208eb6f09beba (diff)
pmt: add binding for __repr__ function
per 3.8 behavior, and the GR wiki, the __repr__ function of a PMT object should be overloaded to call pmt::write_string. This is currently not bound so this adds this binding.
Diffstat (limited to 'gnuradio-runtime/python')
-rw-r--r--gnuradio-runtime/python/pmt/bindings/pmt_python.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gnuradio-runtime/python/pmt/bindings/pmt_python.cc b/gnuradio-runtime/python/pmt/bindings/pmt_python.cc
index 7cb1e530d3..2c301f2f53 100644
--- a/gnuradio-runtime/python/pmt/bindings/pmt_python.cc
+++ b/gnuradio-runtime/python/pmt/bindings/pmt_python.cc
@@ -32,6 +32,7 @@ void bind_pmt(py::module& m)
.def(py::init<>(), D(pmt_base, pmt_base))
.def("__str__", [](const pmt::pmt_t& p) { return pmt::write_string(p); })
+ .def("__repr__", [](const pmt::pmt_t& p) { return pmt::write_string(p); })
.def("is_bool", &pmt_base::is_bool, D(pmt_base, is_bool))