Deutsch   English   Français   Italiano  
<87seuo9ikl.fsf@nosuchdomain.example.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 19:19:38 -0700
Organization: None to speak of
Lines: 65
Message-ID: <87seuo9ikl.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va5108$3tmmd$1@dont-email.me>
	<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
	<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
	<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
	<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
	<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
	<valgpu$34s18$1@dont-email.me>
	<87y14hd4bk.fsf@nosuchdomain.example.com>
	<valnei$35rt8$2@dont-email.me>
	<87ikvlcs7i.fsf@nosuchdomain.example.com>
	<vamclm$3c4ke$1@dont-email.me>
	<87ttf4bdcx.fsf@nosuchdomain.example.com>
	<vaoaak$3l470$3@dont-email.me>
	<875xrkb2iq.fsf@nosuchdomain.example.com>
	<vaoibg$3m9tm$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 04:19:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d17aacdbc8a710bbcdf54ea5a7e9baf3";
	logging-data="3879117"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/NbzE7y9GjaOJOuL4wOT7x"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:scGoBDKGLWY1w4pcT9evxcy0Bc4=
	sha1:kjlQALJ2Xai7r+E+I7yKIkRYtC0=
Bytes: 4183

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> 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?

Perhaps "wrong" overstates it, but your code certainly doesn't follow
common Python conventions.

https://peps.python.org/pep-0257/

>> 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.

So I see.  I don't know why -- and I'm ok with that.

>> 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?

Why would I want to avoid thinking about the big things?

One of Henry Spencer's Ten Commandments for C Programmers seems relevant
(indirectly, of course):

    Thou shalt make thy program's purpose and structure clear to thy
    fellow man by using the One True Brace Style, even if thou likest it
    not, for thy creativity is better used in solving problems than in
    creating beautiful new impediments to understanding.

https://www.lysator.liu.se/c/ten-commandments.html

My impression is that your unconventional style indicates a relative
lack of experience in Python.  Maybe that's an invalid conclusion, but
it's one that others are likely to reach as well.

And if you want to discuss Python, I suggest that comp.lang.python would
be a better place to do so.  I see that you already post there.  (And
you seem to have a problem with the gateway to the python-list mailing
list, for reasons you have declined to explain.)  I follow that
newsgroup, and I'm going to bow out of this thread here.

>> In any language, if a block of code is so deeply indented that it's
>> confusing, you should consider refactoring it.  (Though that's not
>> always the answer.)
>
> The point being, the same kind of code in a language with explicit 
> statement brackets would reach the point of confusion later, rather than 
> sooner.

I'm not convinced of that.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */