Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 19704

What is the most common way to wrap (def) function? [closed]

$
0
0

When I put a lot of variables in one method, the code line become very long and ugly.I'm using the type 1 to shorten the codes, but I'm curious what other people use.

Type 1:

def my_func(  var1: str,  var2: str,  var3: str,  ...) -> None:

Type 2:

def my_func(var1: str,            var2: str,            var3: str,            ...) -> None:

If you use type 1, type 2, or any other, could you explain why you use it?

I'm sure there's probably already been a similar discussion before, but I didn't know how to search it and didn't find it.


Viewing all articles
Browse latest Browse all 19704

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>