diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/py_commodity.cc | 18 | ||||
-rw-r--r-- | src/py_item.cc | 18 | ||||
-rw-r--r-- | src/py_post.cc | 12 |
3 files changed, 32 insertions, 16 deletions
diff --git a/src/py_commodity.cc b/src/py_commodity.cc index c75b5e64..b283efcc 100644 --- a/src/py_commodity.cc +++ b/src/py_commodity.cc @@ -258,8 +258,10 @@ void export_commodity() make_getter(&commodity_pool_t::keep_base), make_setter(&commodity_pool_t::keep_base)) .add_property("price_db", - make_getter(&commodity_pool_t::price_db), - make_setter(&commodity_pool_t::price_db)) + make_getter(&commodity_pool_t::price_db, + return_value_policy<return_by_value>()), + make_setter(&commodity_pool_t::price_db, + return_value_policy<return_by_value>())) .add_property("quote_leeway", make_getter(&commodity_pool_t::quote_leeway), make_setter(&commodity_pool_t::quote_leeway)) @@ -390,11 +392,15 @@ void export_commodity() .add_property("price", py_price, py_set_price) .add_property("date", - make_getter(&annotation_t::date), - make_setter(&annotation_t::date)) + make_getter(&annotation_t::date, + return_value_policy<return_by_value>()), + make_setter(&annotation_t::date, + return_value_policy<return_by_value>())) .add_property("tag", - make_getter(&annotation_t::tag), - make_setter(&annotation_t::tag)) + make_getter(&annotation_t::tag, + return_value_policy<return_by_value>()), + make_setter(&annotation_t::tag, + return_value_policy<return_by_value>())) .def("__nonzero__", &annotation_t::operator bool) diff --git a/src/py_item.cc b/src/py_item.cc index e3e49457..893ddcfa 100644 --- a/src/py_item.cc +++ b/src/py_item.cc @@ -120,14 +120,20 @@ void export_item() #endif .add_property("note", - make_getter(&item_t::note), - make_setter(&item_t::note)) + make_getter(&item_t::note, + return_value_policy<return_by_value>()), + make_setter(&item_t::note, + return_value_policy<return_by_value>())) .add_property("pos", - make_getter(&item_t::pos), - make_setter(&item_t::pos)) + make_getter(&item_t::pos, + return_value_policy<return_by_value>()), + make_setter(&item_t::pos, + return_value_policy<return_by_value>())) .add_property("metadata", - make_getter(&item_t::metadata), - make_setter(&item_t::metadata)) + make_getter(&item_t::metadata, + return_value_policy<return_by_value>()), + make_setter(&item_t::metadata, + return_value_policy<return_by_value>())) .def("copy_details", &item_t::copy_details) diff --git a/src/py_post.cc b/src/py_post.cc index 2789082e..ce3bd71b 100644 --- a/src/py_post.cc +++ b/src/py_post.cc @@ -149,11 +149,15 @@ void export_post() make_getter(&post_t::amount), make_setter(&post_t::amount)) .add_property("cost", - make_getter(&post_t::cost), - make_setter(&post_t::cost)) + make_getter(&post_t::cost, + return_value_policy<return_by_value>()), + make_setter(&post_t::cost, + return_value_policy<return_by_value>())) .add_property("assigned_amount", - make_getter(&post_t::assigned_amount), - make_setter(&post_t::assigned_amount)) + make_getter(&post_t::assigned_amount, + return_value_policy<return_by_value>()), + make_setter(&post_t::assigned_amount, + return_value_policy<return_by_value>())) .def("has_tag", py_has_tag_1s) .def("has_tag", py_has_tag_1m) |