Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-02 Thread Lennart Regebro
On Wed, Apr 1, 2009 at 12:25, Chris Rossi wrote: > Additionally, if I was grokking Lennart correctly yesterday, > __metaclass__ is going away, so the current metaclass implementation > is going to need some rejiggering.  What was unclear was whether a > single implementation could support both <=2

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-02 Thread Lennart Regebro
2009/4/1 Marius Gedminas : > I now also wonder if adapter()/implementer() would work when called with > classes rather than functions...? Yes, in 2.6 and 3.0. Not with the current trunk of zope.interfaces, though, but in the future, sure. -- Lennart Regebro: Pythonista, Barista, Notsotrista. htt

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Dieter Maurer
Martin Aspeli wrote at 2009-4-1 22:02 +0800: >I'd like to add support for the following: > >1) Provider decorator: > > @provider(IFoo) > def some_function(context) > pass I have already searched for this several times -- and was disappointed about my failure :-) -- Dieter __

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Matthew Wilkes
On 1 Apr 2009, at 18:25, Chris Rossi wrote: > Additionally, if I was grokking Lennart correctly yesterday, > __metaclass__ is going away, so the current metaclass implementation > is going to need some rejiggering. What was unclear was whether a > single implementation could support both <=2.5 a

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Chris Rossi
Additionally, if I was grokking Lennart correctly yesterday, __metaclass__ is going away, so the current metaclass implementation is going to need some rejiggering. What was unclear was whether a single implementation could support both <=2.5 and >=2.6. Chris On Wed, Apr 1, 2009 at 1:09 PM, Mar

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Martin Aspeli
Hi Marius, > It's a Python 2.6/3.0 feature: Oh... sniff... I so want that. ;) > from zope.component import adapter > from zope.interface import implementer > > @adapter(IFoo) > @implementer(IBar) > class MyClass(object): > > def __init__(self, context): >

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Marius Gedminas
On Wed, Apr 01, 2009 at 10:56:30PM +0800, Martin Aspeli wrote: > Tres Seaver wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Martin Aspeli wrote: > >> Hi, > >> > >> I'd like to add support for the following: > >> > >> 1) Provider decorator: > >> > >> @provider(IFoo) > >> d

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Martin Aspeli
Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Martin Aspeli wrote: >> Hi, >> >> I'd like to add support for the following: >> >> 1) Provider decorator: >> >> @provider(IFoo) >> def some_function(context) >> pass >> >> This is an alternative to doing a separate

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Aspeli wrote: > Hi, > > I'd like to add support for the following: > > 1) Provider decorator: > > @provider(IFoo) > def some_function(context) > pass > > This is an alternative to doing a separate alsoProvides() on the function. >

Re: [Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Jim Fulton
On Apr 1, 2009, at 10:02 AM, Martin Aspeli wrote: > Hi, > > I'd like to add support for the following: > > 1) Provider decorator: > > @provider(IFoo) > def some_function(context) > pass > > > This is an alternative to doing a separate alsoProvides() on the > function. > > 2) An interface

[Zope-dev] Two small convenience suggestions for zope.interface and zope.component

2009-04-01 Thread Martin Aspeli
Hi, I'd like to add support for the following: 1) Provider decorator: @provider(IFoo) def some_function(context) pass This is an alternative to doing a separate alsoProvides() on the function. 2) An interfaceProvides directive: class IFoo(Interface): interfaceProvides(ISome