[Checkins] SVN: BTrees/branches/py3k/ Py3k doesn't allow bare METH_KEYWORDS.

Tres Seaver cvs-admin at zope.org
Fri Dec 14 22:37:17 UTC 2012


Log message for revision 128666:
  Py3k doesn't allow bare METH_KEYWORDS.
  
  Instead, OR it with METH_VARARGS.

Changed:
  _U  BTrees/branches/py3k/
  U   BTrees/branches/py3k/BTrees/BTreeTemplate.c
  U   BTrees/branches/py3k/BTrees/BucketTemplate.c
  U   BTrees/branches/py3k/BTrees/SetTemplate.c
  U   BTrees/branches/py3k/BTrees/TreeSetTemplate.c

-=-
Modified: BTrees/branches/py3k/BTrees/BTreeTemplate.c
===================================================================
--- BTrees/branches/py3k/BTrees/BTreeTemplate.c	2012-12-14 20:52:37 UTC (rev 128665)
+++ BTrees/branches/py3k/BTrees/BTreeTemplate.c	2012-12-14 22:37:16 UTC (rev 128666)
@@ -2091,18 +2091,18 @@
      "has_key(key)\n\n"
      "Return true if the BTree contains the given key."},
 
-    {"keys", (PyCFunction) BTree_keys, METH_KEYWORDS,
+    {"keys", (PyCFunction) BTree_keys, METH_VARARGS | METH_KEYWORDS,
      "keys([min, max]) -> list of keys\n\n"
      "Returns the keys of the BTree.  If min and max are supplied, only\n"
      "keys greater than min and less than max are returned."},
 
-    {"values", (PyCFunction) BTree_values, METH_KEYWORDS,
+    {"values", (PyCFunction) BTree_values, METH_VARARGS | METH_KEYWORDS,
      "values([min, max]) -> list of values\n\n"
      "Returns the values of the BTree.  If min and max are supplied, only\n"
      "values corresponding to keys greater than min and less than max are\n"
      "returned."},
 
-    {"items", (PyCFunction) BTree_items, METH_KEYWORDS,
+    {"items", (PyCFunction) BTree_items, METH_VARARGS | METH_KEYWORDS,
      "items([min, max]) -> -- list of key, value pairs\n\n"
      "Returns the items of the BTree.  If min and max are supplied, only\n"
      "items with keys greater than min and less than max are returned."},
@@ -2148,13 +2148,13 @@
     {"update", (PyCFunction) Mapping_update, METH_O,
      "update(collection)\n\n Add the items from the given collection."},
 
-    {"iterkeys", (PyCFunction) BTree_iterkeys, METH_KEYWORDS,
+    {"iterkeys", (PyCFunction) BTree_iterkeys, METH_VARARGS | METH_KEYWORDS,
      "B.iterkeys([min[,max]]) -> an iterator over the keys of B"},
 
-    {"itervalues", (PyCFunction) BTree_itervalues, METH_KEYWORDS,
+    {"itervalues", (PyCFunction) BTree_itervalues, METH_VARARGS | METH_KEYWORDS,
      "B.itervalues([min[,max]]) -> an iterator over the values of B"},
 
-    {"iteritems", (PyCFunction) BTree_iteritems, METH_KEYWORDS,
+    {"iteritems", (PyCFunction) BTree_iteritems, METH_VARARGS | METH_KEYWORDS,
      "B.iteritems([min[,max]]) -> an iterator over the (key, value) "
      "items of B"},
 
@@ -2166,7 +2166,8 @@
      (PyCFunction) BTree__p_resolveConflict, METH_VARARGS,
      "_p_resolveConflict() -- Reinitialize from a newly created copy"},
 
-    {"_p_deactivate", (PyCFunction) BTree__p_deactivate, METH_KEYWORDS,
+    {"_p_deactivate",
+     (PyCFunction) BTree__p_deactivate, METH_VARARGS | METH_KEYWORDS,
      "_p_deactivate()\n\nReinitialize from a newly created copy."},
 #endif
     {NULL, NULL}

Modified: BTrees/branches/py3k/BTrees/BucketTemplate.c
===================================================================
--- BTrees/branches/py3k/BTrees/BucketTemplate.c	2012-12-14 20:52:37 UTC (rev 128665)
+++ BTrees/branches/py3k/BTrees/BucketTemplate.c	2012-12-14 22:37:16 UTC (rev 128666)
@@ -1610,7 +1610,7 @@
     {"__setstate__", (PyCFunction) bucket_setstate, METH_O,
      "__setstate__() -- Set the state of the object"},
 
-    {"keys", (PyCFunction) bucket_keys, METH_KEYWORDS,
+    {"keys", (PyCFunction) bucket_keys, METH_VARARGS | METH_KEYWORDS,
      "keys([min, max]) -- Return the keys"},
 
     {"has_key", (PyCFunction) bucket_has_key, METH_O,
@@ -1630,10 +1630,10 @@
      "minKey([key]) -- Find the minimum key\n\n"
      "If an argument is given, find the minimum >= the argument"},
 
-    {"values", (PyCFunction) bucket_values, METH_KEYWORDS,
+    {"values", (PyCFunction) bucket_values, METH_VARARGS | METH_KEYWORDS,
      "values([min, max]) -- Return the values"},
 
-    {"items", (PyCFunction) bucket_items, METH_KEYWORDS,
+    {"items", (PyCFunction) bucket_items, METH_VARARGS | METH_KEYWORDS,
      "items([min, max])) -- Return the items"},
 
     {"byValue", (PyCFunction) bucket_byValue, METH_O,
@@ -1654,13 +1654,14 @@
      "If key is not found, d is returned if given, otherwise KeyError\n"
      "is raised."},
 
-    {"iterkeys", (PyCFunction) Bucket_iterkeys, METH_KEYWORDS,
+    {"iterkeys", (PyCFunction) Bucket_iterkeys, METH_VARARGS | METH_KEYWORDS,
      "B.iterkeys([min[,max]]) -> an iterator over the keys of B"},
  
-    {"itervalues", (PyCFunction) Bucket_itervalues, METH_KEYWORDS,
+    {"itervalues",
+     (PyCFunction) Bucket_itervalues, METH_VARARGS | METH_KEYWORDS,
      "B.itervalues([min[,max]]) -> an iterator over the values of B"},
 
-    {"iteritems", (PyCFunction) Bucket_iteritems, METH_KEYWORDS,
+    {"iteritems", (PyCFunction) Bucket_iteritems, METH_VARARGS | METH_KEYWORDS,
      "B.iteritems([min[,max]]) -> an iterator over the (key, value) "
      "items of B"},
 
@@ -1673,7 +1674,8 @@
      (PyCFunction) bucket__p_resolveConflict, METH_VARARGS,
      "_p_resolveConflict() -- Reinitialize from a newly created copy"},
 
-    {"_p_deactivate", (PyCFunction) bucket__p_deactivate, METH_KEYWORDS,
+    {"_p_deactivate",
+     (PyCFunction) bucket__p_deactivate, METH_VARARGS | METH_KEYWORDS,
      "_p_deactivate() -- Reinitialize from a newly created copy"},
 #endif
     {NULL, NULL}

Modified: BTrees/branches/py3k/BTrees/SetTemplate.c
===================================================================
--- BTrees/branches/py3k/BTrees/SetTemplate.c	2012-12-14 20:52:37 UTC (rev 128665)
+++ BTrees/branches/py3k/BTrees/SetTemplate.c	2012-12-14 22:37:16 UTC (rev 128666)
@@ -182,7 +182,7 @@
     {"__setstate__", (PyCFunction) set_setstate, METH_VARARGS,
      "__setstate__() -- Set the state of the object"},
 
-    {"keys", (PyCFunction) bucket_keys, METH_KEYWORDS,
+    {"keys", (PyCFunction) bucket_keys, METH_VARARGS | METH_KEYWORDS,
      "keys() -- Return the keys"},
 
     {"has_key", (PyCFunction) bucket_has_key, METH_O,
@@ -204,7 +204,8 @@
      (PyCFunction) bucket__p_resolveConflict, METH_VARARGS,
      "_p_resolveConflict() -- Reinitialize from a newly created copy"},
 
-    {"_p_deactivate", (PyCFunction) bucket__p_deactivate, METH_KEYWORDS,
+    {"_p_deactivate",
+     (PyCFunction) bucket__p_deactivate, METH_VARARGS | METH_KEYWORDS,
      "_p_deactivate() -- Reinitialize from a newly created copy"},
 #endif
 

Modified: BTrees/branches/py3k/BTrees/TreeSetTemplate.c
===================================================================
--- BTrees/branches/py3k/BTrees/TreeSetTemplate.c	2012-12-14 20:52:37 UTC (rev 128665)
+++ BTrees/branches/py3k/BTrees/TreeSetTemplate.c	2012-12-14 22:37:16 UTC (rev 128666)
@@ -133,7 +133,7 @@
      "has_key(key)\n\n"
      "Return true if the TreeSet contains the given key."},
 
-    {"keys", (PyCFunction) BTree_keys, METH_KEYWORDS,
+    {"keys", (PyCFunction) BTree_keys, METH_VARARGS | METH_KEYWORDS,
      "keys([min, max]) -> list of keys\n\n"
      "Returns the keys of the TreeSet.  If min and max are supplied, only\n"
      "keys greater than min and less than max are returned."},
@@ -171,7 +171,8 @@
      (PyCFunction) BTree__p_resolveConflict, METH_VARARGS,
      "_p_resolveConflict() -- Reinitialize from a newly created copy"},
 
-    {"_p_deactivate", (PyCFunction) BTree__p_deactivate, METH_KEYWORDS,
+    {"_p_deactivate",
+     (PyCFunction) BTree__p_deactivate, METH_VARARGS | METH_KEYWORDS,
      "_p_deactivate()\n\nReinitialize from a newly created copy."},
 #endif
     {NULL,        NULL}        /* sentinel */



More information about the checkins mailing list