[Pulp-list] Argument Names
Bryan Kearney
bkearney at redhat.com
Wed Apr 6 18:47:19 UTC 2011
On 04/06/2011 02:41 PM, Jay Dobies wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> If you're not going to document your methods, please *at least* use the
> proper pluralization to indicate when an argument is a list or a single
> item. This has bitten me twice today:
>
> def add_package(self, repoid, packageid):
>
> def create(self, id, name, arch, feed=None, symlinks=False,
> sync_schedule=None, feed_cert_data=None,
> consumer_cert_data=None,
> relative_path=None, groupid=None, gpgkeys=None,
> checksum_type="sha256"):
>
> In these examples, "packageid" and "groupid" (yet "repoid" only accepts
> a single repo) actually expect a list in both cases, despite what the
> names of the arguments may indicate.
>
> The better answer is to actually use @param and @type tags to clue in
> your callers in the first place :)
Or.. you could use a typed language :)
-- bk
More information about the Pulp-list
mailing list