[PEAK] Moving forward with PyProtocols and generic functions
Jean-Philippe Dutreve
jdutreve at free.fr
Fri Nov 5 08:10:45 EST 2004
instead of
@protocols.adapter_function(IFoo, adapts_types=[int])
def int_as_foo(anInteger):
# return an IFoo implementation for anInteger
why not use subject/verb like :
@protocols.function_provides(IFoo, adapts_types=[int])
def int_as_foo(anInteger):
# return an IFoo implementation for anInteger
or
@protocols.function_returns(IFoo, adapts_types=[int])
def int_as_foo(anInteger):
# return an IFoo implementation for anInteger
and for class, why not use the same syntax as other things :
@protocols.instances_provide(IFoo, adapts_protocols=[IBar])
class Foo:
Intuitiveness and coherence is important for me.
My 2 cents,
Jean-Philippe
More information about the PEAK
mailing list