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

Tres Seaver tseaver at palladion.com
Wed Apr 1 10:31:57 EDT 2009


-----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.
> 
> 2) An interfaceProvides directive:
> 
> 
>   class IFoo(Interface):
>       interfaceProvides(ISomeMarker)
> 
> This is alternative to doing alsoProvides() on the interface.
> 
> The reason for this is that currently, you have to put those 
> alsoProvides() lines after the function or interface. This makes them 
> difficult to find if the bodies of the functions or interfaces are long, 
> and goes against the convention of having the "what is this" information 
> at the top of the entity.
> 
> I can probably help implement this. Any thoughts?

You should probably add a "class decorator" 'interfaceProvider', as
well, because the "in-suite" versions are problematic for 2to3
conversion (IIRC what Lennart said yesterday).


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ03rd+gerLs4ltQ4RAhmLAJ94wuHpAwJjNu8rylhKZeYn1yV11QCeLh36
zMqCZerP8HNUyFJH4IvNkaY=
=pD4Z
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list