Record in Python else: return root in one line is not welcome?

0 like 0 dislike
26 views
Good afternoon.
Is this the recording in one line is considered custom, rare,
prevents the perception of information in General?

This entry I noticed Peter Norvega when I listened to his online course Design of computer programs.
asked by | 26 views

2 Answers

0 like 0 dislike
Yes, not welcome.
PEP8, subsection “Other recomendations”:
Compound statements (multiple statements on the same line) are generally discouraged.

However, later in PEP8 there is a comment:
While sometimes it's okay to put an if/for/while with a small body on the same line, ...

But in practice, any reviewer will reject the record. For a colon inside a complex expression must follow a new line, so you can easily distinguish it from the colon in a type annotation or, say, a dict comprehension. So what else: return − it is rather a no-no than sometimes ok.
answered by
0 like 0 dislike
welcome

what is the Python root ?
answered by

Related questions

0 like 0 dislike
3 answers
asked Sep 28, 2018 by Venuhaha
0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
asked Nov 20, 2018 by DarthWazer
0 like 0 dislike
2 answers
24,509 questions
45,932 answers
0 comments
345 users