2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 18:52:26 +00:00

implemented list.sort with keyword argument support, by using args_proxy and kwds_proxy. Not a nice solution though...

[SVN r55078]
This commit is contained in:
Haoyu Bai
2009-07-22 05:38:59 +00:00
parent e428495a96
commit 7bf964b1ce
4 changed files with 23 additions and 3 deletions

View File

@@ -7,6 +7,8 @@
#include <boost/python/def.hpp>
#include <boost/python/class.hpp>
#include <boost/python/list.hpp>
#include <boost/python/tuple.hpp>
#include <boost/python/dict.hpp>
#include <boost/python/make_function.hpp>
#include <boost/lexical_cast.hpp>
#define BOOST_ENABLE_ASSERT_HANDLER
@@ -114,7 +116,11 @@ void exercise(list x, object y, object print)
print(x);
print("reverse sorted:");
#if PY_VERSION_HEX >= 0x03000000
x.sort(*tuple(), **dict(make_tuple(make_tuple("reverse", true))));
#else
x.sort(&notcmp);
#endif
print(x);
list w;