Code review comment for lp:~abentley/launchpad/bulk-insert

Revision history for this message
Aaron Bentley (abentley) wrote :

> Is there a general frowning on *args?

I don't know if there's a general one, but I tend to avoid them for this kind of use, because it makes it harder to change the signature later. *args and optional arguments don't play well together. When "foo(*branches)" becomes "foo(dry_run=False, *branches)", lots of code breaks, and the method becomes more awkward to call. [And foo(*args, **kwargs) isn't explicit that dry_run is an acceptable kwarg]

I feel like the gain from using *args that way is negligible, and there are real problems, so I avoid it.

I'm comfortable using *args and **kwargs when I'm wrapping things.

Aaron

« Back to merge proposal