mirror of
https://github.com/boostorg/python.git
synced 2026-01-22 05:22:45 +00:00
Merged 2009 GSoC work from sandbox-branches/bhy/py3k branch back into trunk.
[SVN r56305]
This commit is contained in:
@@ -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
|
||||
@@ -109,11 +111,16 @@ void exercise(list x, object y, object print)
|
||||
|
||||
print("sorted:");
|
||||
x.pop(2); // make sorting predictable
|
||||
x.pop(2); // remove [1,2] so the list is sortable in py3k
|
||||
x.sort();
|
||||
print(x);
|
||||
|
||||
print("reverse sorted:");
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
x.sort(*tuple(), **dict(make_tuple(make_tuple("reverse", true))));
|
||||
#else
|
||||
x.sort(¬cmp);
|
||||
#endif
|
||||
print(x);
|
||||
|
||||
list w;
|
||||
|
||||
Reference in New Issue
Block a user