[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] Argument Names

On 04/06/2011 02:41 PM, Jay Dobies wrote:
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,
                relative_path=None, groupid=None, gpgkeys=None,

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

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]