[Zope-dev] Anyone want to do Google Summer of code mentoring for PSF?

Hanno Schlichting hanno at hannosch.eu
Sun Mar 20 12:24:42 EDT 2011


On Sun, Mar 20, 2011 at 4:31 PM, Martin Aspeli <optilude+lists at gmail.com> wrote:
> I appreciate that in Python 3 the in-class advice (which was pioneered
> by zope.component/zope.interface, don't forget) may not work properly,
> so we may not have any choice eventually.

There's really no choice. The syntax we use today simply doesn't work
in Python 3. We already have 2to3 fixers for zope.interface and
zope.component, which will do the work for you and change things into
decorators like:

class Foo(object):
    implements(IFoo)
    ...

@implementor(IFoo):
class Foo(object):
    ...

Any in-class advice construct will change.

In cases where we use multiple statements per class (like implements +
adapts), I think it's worthwhile to combine these into one
higher-level construct. Registering a view should be done via some
variation of a @view decorator and not by adding multiple low-level
statements.

Hanno


More information about the Zope-Dev mailing list