Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-04 Thread Markus Kemmerling
You are right, I should have provided tests for the changes right away. As pointed out by Stefan, I modified the `findRelationships` and `isLinked` methods in the `shared` module to no longer use logical operations to check if a `target` object was provided. As far as I can see, that

Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-04 Thread Gary Poster
On Jul 4, 2007, at 5:59 PM, Markus Kemmerling wrote: You are right, I should have provided tests for the changes right away. Thank you very much! The following releases have your fix. http://cheeseshop.python.org/pypi/zc.relationship/1.0.2 (stable, used for ZODB 3.7/Zope 3.3/Zope 2.10)

[Zope3-dev] two small bugs in zc.relationship

2007-07-02 Thread Markus Kemmerling
Hi, I discovered two smalll bugs in `zc.relationship`. The first is just a typo in the `ManyToOneRelationship` convenience class of the `shared`module: @@ -149,7 +149,7 @@ interface.implements(interfaces.IManyToOneRelationship) def __init__(self, sources, target): -

Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-02 Thread Benji York
Markus Kemmerling wrote: But I wouldn't have expected a non built-in type, that *also* supports the mapping API, to be considered as `False` as long as the mapping is empty ... Built-in or otherwise, empty containers are almost universally false in Python. -- Benji York Senior Software

Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-02 Thread Stefan H. Holek
As a general rule you should avoid taking the boolean value of objects. You never know what the result will be and how expensive the underlying operations are (e.g. computing the length of a BTree can be *very* expensive). Stefan On 2. Jul 2007, at 14:24, Markus Kemmerling wrote: But I

Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-02 Thread Markus Kemmerling
Certainly true. I just wanted the bug fix to stay in sync with the package author's coding style. He already used logical operator magic to mimic the '?:' ternary operator in a similar method. I myself prefer boring if ... else constructs. Markus Kemmerling Am 02.07.2007 um 14:51 schrieb

Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-02 Thread Gary Poster
On Jul 2, 2007, at 3:24 PM, Markus Kemmerling wrote: Hi, I discovered two smalll bugs in `zc.relationship`. Thanks, I'll get those in 24 hours or so. FWIW, generally, tests would be appreciated too, particularly of the index. I'll make one for the index: I use that heavily and the tests

Re: [Zope3-dev] two small bugs in zc.relationship

2007-07-02 Thread Gary Poster
On Jul 2, 2007, at 6:19 PM, Gary Poster wrote: On Jul 2, 2007, at 3:24 PM, Markus Kemmerling wrote: Hi, I discovered two smalll bugs in `zc.relationship`. Thanks, I'll get those in 24 hours or so. FWIW, generally, tests would be appreciated too, particularly of the index. I'll make