Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster


On Nov 17, 2006, at 11:44 AM, Christian Theune wrote:


Gary Poster wrote:

Yeah, it makes me a little nervous too.  I'm comfortable saying this
should go on the trunk, but I'd default to saying that it shouldn't
be backported, unless there's a groundswell of support.


Splitting up the patch into a bug fix and a feature doesn't make any
sense, does it?


I don't know the context--what the entire patch is that we're talking  
about.  If there are other parts of the issue other than the bare  
try...except then yeah, I think that would be ok.


Gary

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Christian Theune
Gary Poster wrote:
> Yeah, it makes me a little nervous too.  I'm comfortable saying this  
> should go on the trunk, but I'd default to saying that it shouldn't  
> be backported, unless there's a groundswell of support.

Splitting up the patch into a bug fix and a feature doesn't make any
sense, does it?

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development




signature.asc
Description: OpenPGP digital signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster


On Nov 17, 2006, at 11:38 AM, Christian Theune wrote:




Gary Poster wrote:

On Nov 17, 2006, at 11:29 AM, Adam Groszer wrote:

I propose to remove the try/except.
Is that OK?


Yes, I think removing the bare try...except is definitely the right
thing to do.  (Anyone care to disagree?)


Would that change the status of this to be a feature change instead  
of a

bug fix?

(I'd argue it's still a candidate for a bug fix, but people might rely
on this behavior in existing applications which makes it more of a
feature change.)


Yeah, it makes me a little nervous too.  I'm comfortable saying this  
should go on the trunk, but I'd default to saying that it shouldn't  
be backported, unless there's a groundswell of support.


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Christian Theune


Gary Poster wrote:
> On Nov 17, 2006, at 11:29 AM, Adam Groszer wrote:
> 
>> Hello Gary,
>>
>> At the moment it is
>> try:
>> value = value()
>> except:
>> return None
>>
>> So that will eat the exception without any signs.
>> That makes me also glum when I have to dig deep to discover that
>> something ate an exception.
>>
>> I propose to remove the try/except.
>> Is that OK?
> 
> Yes, I think removing the bare try...except is definitely the right  
> thing to do.  (Anyone care to disagree?)

Would that change the status of this to be a feature change instead of a
bug fix?

(I'd argue it's still a candidate for a bug fix, but people might rely
on this behavior in existing applications which makes it more of a
feature change.)

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development




signature.asc
Description: OpenPGP digital signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Christian Theune

Gary Poster wrote:
> On Nov 17, 2006, at 11:13 AM, Adam Groszer wrote:
>>
>> Two more questions remain open, but I think they are easy to answer.
>>
>> In case the field is callable but the method to be called is None
> 
> Yes, remove from index.

Same behaviour as for a None value, so remove from index as Gary said.

> I think the exception should be raised.  What to do here is a policy  
> decision that shouldn't be controlled at the index level IMO.   
> Generally I'd prefer a transaction abort, a system exception, and a  
> log entry, for instance.  When that's not acceptable, it's usually  
> within a part of a transaction that I again can control with a  
> savepoint, so that I revert to before the change that caused the  
> reindex, log the error, and proceed.

Yes please. Fail early and explicitly.


-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development




signature.asc
Description: OpenPGP digital signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster


On Nov 17, 2006, at 10:46 AM, Gary Poster wrote:



This is a less efficient approach than the zc.catalog approach.


Clarification:

Less efficient from a data storage perspective.  From a search  
perspective, it is more efficient.


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RFC: should z.a.c.attribute.AttributeIndex index None values?

2006-11-17 Thread Gary Poster


On Nov 17, 2006, at 10:23 AM, Adam Groszer wrote:


Hello,

Solutions:

a: No, do not keep None values in the catalog
   the current implementation works like this
   you are unable to ask the catalog for objects having None
   properties
b: Yes, keep None values in the catalog
   you can ask the catalog for objects having None properties
c: Let's keep the existing one that does not index None and have an
   AttributeIndexAlsoNone class which will index None values


Did you see my reply in the other thread?

If you make indexes keep track of None, it will need to be done in a  
separate data structure because of the key homogeneity issues.  This  
is a less efficient approach than the zc.catalog approach.  It can be  
done either way.


I recommend that you use zc.catalog, rather than reinventing  
something that solves your problem.


I suppose I don't care much, since we don't use the standard zope  
value and keyword indexes anyway; if you must add the None feature,  
then I only care, from a "let's not screw up our community software"  
perspective, that it be implemented in a safe way.  Keep your BTree  
keys homogenous.


Gary

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com