Re: [Zope-dev] adapting to None

2008-12-13 Thread Dieter Maurer
Chris Withers wrote at 2008-12-13 10:42 +: > ... > From looking at the python implementation of Interface, __call__ is >indicated to be the method to override, but with the C-based Interface, >this has no effect. Why is that? > >*That's* what I'm looking for help with, not judgement on whethe

Re: [Zope-dev] Fwd: Help with RelStorage ...

2008-12-13 Thread Shane Hathaway
Gareth Bult wrote: > I'm having a bit of a problem that looks like a 32 bit vs 64 bit issue > with RelStorage, can anyone help? We need to get more people to use RelStorage so more people can help. :-) This looks like a good clue: > ==

Re: [Zope-dev] adapting to None

2008-12-13 Thread Alec Mitchell
Chris Withers simplistix.co.uk> writes: > > Hi All, > > I have a need to be able to adapting certain objects to None, eg: > > def some_adapter(obj): >if something: > return None >return somethingelse > > This is tricky, since returning None from an adapter results in a TypeError.

[Zope-dev] Zope Tests: 4 OK, 2 Failed

2008-12-13 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list. Period Fri Dec 12 12:00:00 2008 UTC to Sat Dec 13 12:00:00 2008 UTC. There were 6 messages: 6 from Zope Tests. Test failures - Subject: FAILED (failures=2) : Zope-trunk Python-2.4.5 : Linux From: Zope Tests Date: Fri Dec 12 20:37:00 EST 200

Re: [Zope-dev] adapting to None

2008-12-13 Thread Marius Gedminas
On Sat, Dec 13, 2008 at 10:42:09AM +, Chris Withers wrote: > Dieter Maurer wrote: > > Then, use something different from adaptation (as adaptation does > > not fit your wishes). > > This is what I'm trying to do with subclassing, and my question was why > that subclassing wasn't working... S

Re: [Zope-dev] adapting to None

2008-12-13 Thread Chris Withers
Dieter Maurer wrote: > Then, use something different from adaptation (as adaptation does > not fit your wishes). This is what I'm trying to do with subclassing, and my question was why that subclassing wasn't working... > I expect that your adapter factory can raise "ComponentLookupError" > when

Re: [Zope-dev] adapting to None

2008-12-13 Thread Dieter Maurer
Chris Withers wrote at 2008-12-13 10:18 +: >Dieter Maurer wrote: >> I think that in some cases, it would be useful for an adapter factory >> to say 'I cannot handle this case' and then the adapter lookup >> is continued. Maybe, this is already supported? >> Then, maybe, you can use it? > >That'

Re: [Zope-dev] adapting to None

2008-12-13 Thread Chris Withers
Dieter Maurer wrote: > I think that in some cases, it would be useful for an adapter factory > to say 'I cannot handle this case' and then the adapter lookup > is continued. Maybe, this is already supported? > Then, maybe, you can use it? That's exactly what returning None indicates... >> def som

Re: [Zope-dev] adapting to None

2008-12-13 Thread Dieter Maurer
Chris Withers wrote at 2008-12-13 02:17 +: >I have a need to be able to adapting certain objects to None, eg: > >def some_adapter(obj): > if something: > return None > return somethingelse Your use case seems to abuse adaptation: Adaptation to an interface must always return an obje