On Thu, Apr 10, 2014 at 7:12 PM, Christian Tismer <tis...@stackless.com>wrote:

> Then I rather often see things like this:
>
> class someclass(object):
>     # note that there is no comment about argument destruction...
>
>     def __init__(self, **kwargs):
>         first_arg = kwargs.pop('option_1', somedefault)
>         ...
>         nth_arg = kwargs.pop('option_n', somedefault')
>         ...
>

While it's been clarified that this isn't dangerous, I find it to be a
really annoying style, as you've lost the opurtuniyt to docuemnt somethign
in the signature. Is:

    def __init__(self, option_1=some_default, option_n=some_default,
**kwargs):
        first_arg = kwargs.pop('option_1')
        nth_arg = kwargs.pop('option_n')

*that* much harder to write?

And many of these come with virtually no docstring, either.....

oh well,

  -Chris


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to