summaryrefslogtreecommitdiff
path: root/src/py_commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 17:16:59 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 17:16:59 -0500
commit1bdb9330e56e49ecd660f3aafdc2d349a20e3044 (patch)
treef352e064a65bc7f3a87a634b1fcc689bb2441305 /src/py_commodity.cc
parent312d4c5f5339c61253e86cd9ce825370eb4be053 (diff)
downloadfork-ledger-1bdb9330e56e49ecd660f3aafdc2d349a20e3044.tar.gz
fork-ledger-1bdb9330e56e49ecd660f3aafdc2d349a20e3044.tar.bz2
fork-ledger-1bdb9330e56e49ecd660f3aafdc2d349a20e3044.zip
Simplified passing of scope objects in Python
Diffstat (limited to 'src/py_commodity.cc')
-rw-r--r--src/py_commodity.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/py_commodity.cc b/src/py_commodity.cc
index c20053ad..08af8f62 100644
--- a/src/py_commodity.cc
+++ b/src/py_commodity.cc
@@ -157,23 +157,23 @@ void export_commodity()
.def("make_qualified_name", &commodity_pool_t::make_qualified_name)
- .def("create", py_create_1, return_value_policy<reference_existing_object>())
- .def("create", py_create_2, return_value_policy<reference_existing_object>())
+ .def("create", py_create_1, return_internal_reference<>())
+ .def("create", py_create_2, return_internal_reference<>())
.def("find_or_create", py_find_or_create_1,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
.def("find_or_create", py_find_or_create_2,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
- .def("find", py_find_1, return_value_policy<reference_existing_object>())
- .def("find", py_find_2, return_value_policy<reference_existing_object>())
+ .def("find", py_find_1, return_internal_reference<>())
+ .def("find", py_find_2, return_internal_reference<>())
.def("exchange", py_exchange_3, with_custodian_and_ward<1, 2>())
.def("exchange", py_exchange_5)
.def("parse_price_directive", &commodity_pool_t::parse_price_directive)
.def("parse_price_expression", &commodity_pool_t::parse_price_expression,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
;
scope().attr("COMMODITY_STYLE_DEFAULTS") = COMMODITY_STYLE_DEFAULTS;
@@ -211,16 +211,16 @@ void export_commodity()
#if 0
.def("referent", &commodity_t::referent,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
#endif
.def("is_annotated", &commodity_t::is_annotated)
.def("strip_annotations", &commodity_t::strip_annotations,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
.def("write_annotations", &commodity_t::write_annotations)
.def("pool", &commodity_t::pool,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
.def("base_symbol", &commodity_t::base_symbol)
.def("symbol", &commodity_t::symbol)
@@ -308,11 +308,11 @@ void export_commodity()
#if 0
.def("referent", &annotated_commodity_t::referent,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
#endif
.def("strip_annotations", &annotated_commodity_t::strip_annotations,
- return_value_policy<reference_existing_object>())
+ return_internal_reference<>())
.def("write_annotations", &annotated_commodity_t::write_annotations)
;
}