launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #09244
Re: Help please - launchpadlib collections
On Fri 13 Apr 2012 00:32:34 EST, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12-04-11 09:17 PM, Ian Booth wrote:
>> Plus, it is possible to iterate over the named services and see
>> what's there, what service interfaces are implemented, what methods
>> are available etc. ie a classic discoverability pattern.
>
> But this is also true of the lp.servicefoo approach. dir(lp) will
> list them, getattr can retrieve them. So I don't think the
> discoverability/iteration argument is a strong one.
>
dir(lp) will list the services for sure, but also everything else as
well. Having the top level collection 'services' provides a namespace of
sorts which I think is necessary.
Follow ups
References