> On 14 Sep 2018, at 09:26, Michael Selik <[email protected]> wrote:
> 
> 
> 
> On Fri, Sep 14, 2018, 12:17 AM Anders Hovmöller <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> That's a bit of a dodge. There is a huge difference in verbosity between 
> 
> handler.new_file(field_name, file_name, content_type, content_length, 
> charset, content_type_extra)
> 
> and 
> 
> handler.new_file(field_name=field_name, file_name=file_name, 
> content_type=content_type, content_length=content_length, charset=charset, 
> content_type_extra=content_type_extra)
> 
> Since neither version fits well on one line or even three, I'd have written 
> each of those on a separate line, indented nicely to emphasize the 
> repetition. Seems fine to me.

Sure. As would I. Doesn't change anything:

handler.new_file(
        field_name=field_name, 
        file_name=file_name, 
        content_type=content_type, 
        content_length=content_length, 
        charset=charset, 
        content_type_extra=content_type_extra,
)

> The real problem with this code section wasn't the positional arguments, but 
> that it was so heavily indented. Whenever I have code so nested, I put in a 
> great deal of effort to refactor so that I can avoid the nesting of many 
> try/except, for, and if/else statements.

Most code has many problems. Bringing up random other problems instead of 
sticking to the topic doesn't seem very helpful. Or did you want to change the 
topic to generally be about how to clean up code? If so I'd like to know so I 
can stop responding, because that's not what I am trying to discuss.

/ Anders
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to