]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/python/test/dict.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / python / test / dict.cpp
index 375905d69ab188ca9058198fb9d523fe4ae95358..4f3490a42189152e239a65cbd8431ea43b637255 100644 (file)
@@ -21,11 +21,13 @@ object new_dict()
 object data_dict()
 {
     dict tmp1;
-    tmp1["key1"] = "value1";
 
     dict tmp2;
     tmp2["key2"] = "value2";
     tmp1[1] = tmp2;
+
+    tmp1["key1"] = "value1";
+
     return tmp1;
 }
 
@@ -60,22 +62,20 @@ void work_with_dict(dict data1, dict data2)
 void test_templates(object print)
 {
     std::string key = "key";
-    
+
     dict tmp;
-    tmp[1] = "a test string";
-    print(tmp.get(1));
-    //print(tmp[1]);
     tmp[1.5] = 13;
     print(tmp.get(1.5));
+    tmp[1] = "a test string";
+    print(tmp.get(1));
     print(tmp.get(44));
     print(tmp);
     print(tmp.get(2,"default"));
     print(tmp.setdefault(3,"default"));
 
     BOOST_ASSERT(!tmp.has_key(key));
-    //print(tmp[3]);
 }
-    
+
 BOOST_PYTHON_MODULE(dict_ext)
 {
     def("new_dict", new_dict);