Commit bfdd90aa authored by Tim Peters's avatar Tim Peters

Repair description of TEST_VALUE (the TEST_KEY text it referenced

vanished).
parent 6b92cb69
...@@ -41,17 +41,16 @@ Tests whether the PyObject* K can be converted to the (C) key type ...@@ -41,17 +41,16 @@ Tests whether the PyObject* K can be converted to the (C) key type
non-zero for true). When it returns false, its caller should probably non-zero for true). When it returns false, its caller should probably
set a TypeError exception. set a TypeError exception.
TEST_KEY_SET_OR(V, K, T) TEST_KEY_SET_OR(V, K, T)
Like Python's cmp(). Compares K(ey) to T(arget), where K & T are C Like Python's cmp(). Compares K(ey) to T(arget), where K & T are C
data values of type KEY_TYPE). values of type KEY_TYPE. V is assigned an int value depending on
the outcome:
< 0 if K < T < 0 if K < T
== 0 if K == T == 0 if K == T
> 0 if K > T > 0 if K > T
The value is assigned to V. This macro acts like an 'if', This macro acts like an 'if', where the following statement is
where the following statement is executed only if a Python exception executed only if a Python exception has been raised because the
has been raised because the values could not be compared. values could not be compared.
DECREF_KEY(K) DECREF_KEY(K)
K is a value of KEY_TYPE. If KEY_TYPE is a flavor of PyObject*, write K is a value of KEY_TYPE. If KEY_TYPE is a flavor of PyObject*, write
...@@ -85,8 +84,14 @@ Macros for Values ...@@ -85,8 +84,14 @@ Macros for Values
VALUE_TYPE VALUE_TYPE
The C type declaration for values (e.g., int or PyObject*). The C type declaration for values (e.g., int or PyObject*).
TEST_VALUE(K, T) TEST_VALUE(X, Y)
Like TEST_KEY, except applied to values of VALUE_TYPE. Like Python's cmp(). Compares X to Y, where X & Y are C values of
type VALUE_TYPE. The macro returns an int, with value
< 0 if X < Y
== 0 if X == Y
> 0 if X > Y
XXX There is no provision for determining whether the comparison
attempt failed (set a Python exception).
DECREF_VALUE(K) DECREF_VALUE(K)
Like DECREF_KEY, except applied to values of VALUE_TYPE. Like DECREF_KEY, except applied to values of VALUE_TYPE.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment