Sujet : Re: Python (was Re: I did not inhale)
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 29. Aug 2024, 13:05:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vapo6l$3v4l8$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 29/08/2024 03:19, Lawrence D'Oliveiro wrote:
On Wed, 28 Aug 2024 17:23:25 -0700, Keith Thompson wrote:
That's not the conventional way to format a docstring. If you're using
backslashes to splice lines in Python, it's likely you're doing
something wrong.
What exactly is wrong?
I think "is not None" is more idiomatic.
When I want an equality comparison, I use “==”, not “is”.
You don't need the \ if you put the ( on the same line.
But I do otherwise.
You leave a space between "else" and ":". It's not wrong, but it's not
something I've ever seen.
People who look at my code tend to get triggered by the little things;
maybe it’s a way to avoid thinking about the big things?
"""
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.
"""
You are clearly aiming for the second method here - put in so much extra crap and silliness that readers get caught up in that instead of noticing that most of the function is meaningless.