Skip to content

Commit

Permalink
Fix value-based comparison under Py3k.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed May 25, 2013
1 parent 912b0a2 commit e994712
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BTrees/objectvaluemacros.h
Expand Up @@ -2,7 +2,7 @@

#define VALUE_TYPE PyObject *
#define VALUE_TYPE_IS_PYOBJECT
#define TEST_VALUE(VALUE, TARGET) COMPARE((VALUE),(TARGET))
#define TEST_VALUE(VALUE, TARGET) (COMPARE((VALUE),(TARGET)))

This comment has been minimized.

Copy link
@mgedmin

mgedmin May 27, 2013

Member

This leaves the COMPARE macro itself as a ticking operator precedence time bomb. Why not fix it at the root?

#define DECLARE_VALUE(NAME) VALUE_TYPE NAME
#define INCREF_VALUE(k) Py_INCREF(k)
#define DECREF_VALUE(k) Py_DECREF(k)
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@
Unreleased
----------

- Fix value-based comparison for objects under Py3k: addresses invalid
merges of ``[OLI]OBTrees/OBuckets``.

- Ensure that pure-Python implementation of ``OOBTree.byValue`` matches
semantics (reversed-sort) of C implementation.

Expand Down

0 comments on commit e994712

Please sign in to comment.