[PEAK] The road to PyProtocols 1.0
Gabriel Jägenstedt
gabriel.j at telia.com
Sun May 30 13:48:32 EDT 2004
> I'm not talking about changing 'adapt()', but rather the functions one
> uses as adapters. For example, if you have a protocol IInteger, and
> define an adapter function thus:
>
> def makeInteger(ob,proto):
> return int(ob)
>
> declareAdapter(makeInteger,provides=[IInteger],forTypes=[object])
>
>
> I am proposing this be changed to:
>
>
> def makeInteger(ob):
> return int(ob)
>
> declareAdapter(makeInteger,provides=[IInteger],forTypes=[object])
>
> Thus removing the unused 'proto' argument. Jim Fulton has previously
> pointed out that none of PEAK's adapter functions or classes ever use
> the 'proto' argument, and that for any given case where you might need
> it, it can be supplied by the declarer anyway (though perhaps
> awkwardly). So I'm considering dropping it.
I see.. =)
--
//gabriel - a true believer
More information about the PEAK
mailing list