Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #181: Atilla the Hub


comp / comp.lang.python / Re: Python Dialogs

SubjectAuthor
* Python DialogsStefan Ram
+* Re: Python DialogsLoris Bennett
|+- Re: Python DialogsPeter J. Holzer
|`* Re: Python Dialogsjak
| +* Re: Python DialogsStefan Ram
| |+* Re: Python DialogsStefan Ram
| ||`- Re: Python Dialogsjak
| |`- Re: Python Dialogs (Posting On Python-List Prohibited)Lawrence D'Oliveiro
| `- Re: Python DialogsChris Angelico
`* Re: Python Dialogs (Posting On Python-List Prohibited)Lawrence D'Oliveiro
 `- Re: Python Dialogs (Posting On Python-List Prohibited)Alan Bawden

1
Subject: Python Dialogs
From: Stefan Ram
Newsgroups: comp.lang.python
Organization: Stefan Ram
Date: Thu, 2 May 2024 14:23 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Python Dialogs
Date: 2 May 2024 14:23:19 GMT
Organization: Stefan Ram
Lines: 41
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <dialog-20240502150909@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de DH6XgNXg+yO/zChxBoB+yAmfNwDP2WoupUToXLr/7skvod
Cancel-Lock: sha1:9P/EqVxogQ8CIbQaWTkL/T1aL64= sha256:XBauTi2w6M56vtpScXmRzGJ6EhzJ2cjRtxWfl+Ob6Rc=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
View all headers

Me (indented by 2) and the chatbot (flush left). Lines lengths > 72!

Assume you have an expression "s.replace('a','b').replace('c','d').
replace('e','f').replace('g','h')". Its value is a string which
is the value of s, but with "a" replaced by "b", "c" replaced by
"d", "e" replaced by "f" and "g" replaced by "h". How to modify
this expression, so that "a", "c", "e", and "g", respectively,
are replaced only if they are words (but not parts of words)?

import re

s.replace(r"\ba\b", "b").replace(r"\bc\b", "d").replace(r"\be\b", "f").replace(r"\bg\b", "h")

No. "replace" will not use regular expressions, even if you write
"import re".

import re

s = re.sub(r"\ba\b", "b", s)
s = re.sub(r"\bc\b", "d", s)
s = re.sub(r"\be\b", "f", s)
s = re.sub(r"\bg\b", "h", s)

Now you give me a sequence of four statements, but I need an
expression!

s = re.sub(r"\ba\b", "b", re.sub(r"\bc\b", "d", re.sub(r"\be\b", "f", re.sub(r"\bg\b", "h", s))))

Yeah, that's an expression, but it's kind of nested I guess.
Can you write another expression with less nesting?

s = re.sub(r"\ba\b|\bc\b|\be\b|\bg\b", lambda x: {"a": "b", "c": "d", "e": "f", "g": "h"}[x.group()], s)

Nice idea! Only drawback is that to add another word, you gotta
modify in two places.

replacements = {"a": "b", "c": "d", "e": "f", "g": "h"}
s = re.sub(r"\b(" + "|".join(replacements.keys()) + r")\b", lambda x: replacements[x.group()], s)

PS: This is for the script I use to send posts. So if you do not
see "trying to" (5 letters: "t-r-y-n-a") here, it kind of worked!

Subject: Re: Python Dialogs
From: Loris Bennett
Newsgroups: comp.lang.python
Organization: FUB-IT (ex-ZEDAT), Freie Universität Berlin
Date: Thu, 2 May 2024 14:34 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: loris.bennett@fu-berlin.de (Loris Bennett)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: Thu, 02 May 2024 16:34:38 +0200
Organization: FUB-IT (ex-ZEDAT), Freie Universität Berlin
Lines: 13
Message-ID: <87frv02sg1.fsf@zedat.fu-berlin.de>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: news.uni-berlin.de rvAOt3JCU7diby7N4pzoow4kPSORYr4K43uRaJ9VLFLTIP
Cancel-Lock: sha1:6pln4xHwX+DJ5aL+hQLwbxwh5jw= sha1:EFN9kO2HOjfH+cUPte0IiloTtwc= sha256:jvXJ/4lC9uZM/SV21Xg0Ss/fETG8BOFVynYkz/wcRhA=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
View all headers

ram@zedat.fu-berlin.de (Stefan Ram) writes:

> Me (indented by 2) and the chatbot (flush left). Lines lengths > 72!

Is there a name for this kind of indentation, i.e. the stuff you are
writing not being flush left? It is sort of contrary to
what I think of as "normal" indentation. You seem to use it in all your
postings, too, which hurts my brain, but I guess that's my problem :-)

[snip (40 lines)]

--
This signature is currently under constuction.

Subject: Re: Python Dialogs (Posting On Python-List Prohibited)
From: Lawrence D'Oliv
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Fri, 3 May 2024 02:02 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs (Posting On Python-List Prohibited)
Date: Fri, 3 May 2024 02:02:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <v11gkh$9q5g$2@dont-email.me>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 03 May 2024 04:02:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cfd0dd0a0e9abee8835016bed2d05754";
logging-data="321712"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18InmHwPNYLad0IzpunzP+f"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:iZNKPiq7tPGCvS+EqJyEabYwUO0=
View all headers

> Assume you have an expression "s.replace('a','b').replace('c','d').
> replace('e','f').replace('g','h')". Its value is a string which
> is the value of s, but with "a" replaced by "b", "c" replaced by
> "d", "e" replaced by "f" and "g" replaced by "h". How to modify
> this expression, so that "a", "c", "e", and "g", respectively,
> are replaced only if they are words (but not parts of words)?

import re

replacements = (("a", "b"), ("c", "d"), ("e", "f"), ("g", "h"))

text = "this be a test g eg"

"".join \
(
repl.get(s, s)
for repl in (dict(replacements),)
for s in
re.split("\\b(" + "|".join(re.escape(s[0]) for s in replacements) + ")\\b", text)
)

result:

'this be b test h eg'

Subject: Re: Python Dialogs (Posting On Python-List Prohibited)
From: Alan Bawden
Newsgroups: comp.lang.python
Organization: ITS Preservation Society
Date: Fri, 3 May 2024 07:16 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!bawden.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs (Posting On Python-List Prohibited)
Date: Fri, 03 May 2024 03:16:35 -0400
Organization: ITS Preservation Society
Lines: 35
Message-ID: <86v83vmkks.fsf@williamsburg.bawden.org>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<v11gkh$9q5g$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 03 May 2024 09:16:38 +0200 (CEST)
Injection-Info: bawden.eternal-september.org; posting-host="8c1c5e363e6bcb94508491a3ca9524fb";
logging-data="445037"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18igSM1+++rc9yECGptu9fX"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:jARFzP3uSlY0SPhG+94F2WZXSVg=
sha1:jkOh6o3xX8ODN1wqBNEMNb1uAcM=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> Assume you have an expression "s.replace('a','b').replace('c','d').
> replace('e','f').replace('g','h')". Its value is a string which
> is the value of s, but with "a" replaced by "b", "c" replaced by
> "d", "e" replaced by "f" and "g" replaced by "h". How to modify
> this expression, so that "a", "c", "e", and "g", respectively,
> are replaced only if they are words (but not parts of words)?

import re

replacements = (("a", "b"), ("c", "d"), ("e", "f"), ("g", "h"))

text = "this be a test g eg"

"".join \
(
repl.get(s, s)
for repl in (dict(replacements),)
for s in
re.split("\\b(" + "|".join(re.escape(s[0]) for s in replacements) + ")\\b", text)
)

How about just:

repl = {
"a" : "b",
"c" : "d",
"e" : "f",
"g" : "h",
}

"".join(repl.get(s, s) for s in re.split(r"\b", text))

- Alan

Subject: Re: Python Dialogs
From: Peter J. Holzer
Newsgroups: comp.lang.python
Date: Sat, 4 May 2024 20:00 UTC
References: 1 2 3
Attachments: signature.asc (application/pgp-signature)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-python@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: Sat, 4 May 2024 22:00:02 +0200
Lines: 48
Message-ID: <mailman.7.1714853188.3326.python-list@python.org>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de>
<20240504200002.fugyv4rd34dvapeg@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="tg3yrqlf7hlyhlzx"
X-Trace: news.uni-berlin.de 3J8Q42w3+7nYjRkV47P6jgOqk5SMf6CzBztoVQqbhRFg==
Cancel-Lock: sha1:i9TnOhLusLcvGWH9MGCCSZa1J9I= sha256:YKsjqswN8AXDU6eiR24ORi58x3ib1rCWTIfSAZL4+Pg=
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'content-
type:multipart/signed': 0.05; 'content-type:application/pgp-
signature': 0.09; 'filename:fname piece:asc': 0.09;
'filename:fname piece:signature': 0.09;
'filename:fname:signature.asc': 0.09; 'writes:': 0.09;
'subject:Python': 0.12; '"creative': 0.16; '+0200,': 0.16; '__/':
0.16; 'bennett': 0.16; 'challenge!"': 0.16; 'contrary': 0.16;
'from:addr:hjp-python': 0.16; 'from:addr:hjp.at': 0.16;
'from:name:peter j. holzer': 0.16; 'hjp@hjp.at': 0.16; 'holzer':
0.16; 'reality.': 0.16; 'stross,': 0.16; 'url-ip:212.17.106/24':
0.16; 'url-ip:212.17/16': 0.16; 'url:hjp': 0.16; '|_|_)': 0.16;
'wrote:': 0.16; 'to:addr:python-list': 0.20; 'i.e.': 0.22;
'lines': 0.23; 'stuff': 0.25; 'stefan': 0.26; 'sense': 0.28;
'think': 0.32; 'python-list': 0.32; 'there': 0.33; 'header:In-
Reply-To:1': 0.34; 'received:212': 0.62; 'everything': 0.63;
'well': 0.65; 'received:userid': 0.66; 'url-ip:212/8': 0.69;
'known': 0.84; 'received:at': 0.84
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <87frv02sg1.fsf@zedat.fu-berlin.de>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <20240504200002.fugyv4rd34dvapeg@hjp.at>
X-Mailman-Original-References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de>
View all headers

On 2024-05-02 16:34:38 +0200, Loris Bennett via Python-list wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
> > Me (indented by 2) and the chatbot (flush left). Lines lengths > 72!
>
> Is there a name for this kind of indentation, i.e. the stuff you are
> writing not being flush left?

Ramism.

> It is sort of contrary to what I think of as "normal" indentation.

Stefan is well known for doing everything contrary to normal convention.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)
Subject: Re: Python Dialogs
From: jak
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Mon, 6 May 2024 10:47 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@please.ty (jak)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: Mon, 6 May 2024 12:47:43 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <v1acge$2h0qo$1@dont-email.me>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 06 May 2024 12:47:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b67e37e57a13f30a7c27c16f1d59e3e8";
logging-data="2655064"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Vv8grcaNZZBIWlFLn0ZzU"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.2
Cancel-Lock: sha1:DFveLBLuOxYSNh5rUY37ORYbofA=
In-Reply-To: <87frv02sg1.fsf@zedat.fu-berlin.de>
View all headers

Loris Bennett ha scritto:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> Me (indented by 2) and the chatbot (flush left). Lines lengths > 72!
>
> Is there a name for this kind of indentation, i.e. the stuff you are
> writing not being flush left? It is sort of contrary to
> what I think of as "normal" indentation. You seem to use it in all your
> postings, too, which hurts my brain, but I guess that's my problem :-)
>
> [snip (40 lines)]
>

It's not just your problem. When the texts are particularly long and
complex, I happen to use Google-Translator. It makes bad translations if
the lines are interrupted by the newline, so I wrote a tool dedicated to
Stefan and to all those who indent like him. This tool takes the text
from the clipboard, removes all the superfluous spaces, combines all the
lines in one and puts the result back into the clipboard. :-D

Subject: Re: Python Dialogs
From: Stefan Ram
Newsgroups: comp.lang.python
Organization: Stefan Ram
Date: Mon, 6 May 2024 11:43 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: 6 May 2024 11:43:01 GMT
Organization: Stefan Ram
Lines: 17
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <spaces-20240506123628@ram.dialup.fu-berlin.de>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de> <87frv02sg1.fsf@zedat.fu-berlin.de> <v1acge$2h0qo$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de XPbNwyJ7e4Xn6b56nwBE6A3SyoqC6l1VZe1Lhvantu8b51
Cancel-Lock: sha1:/0Q+zJZBpj30vR3dYodAUl/UO3g= sha256:u8y5Ycv72RGVvQgfhb5BrXA2n0DUx5+jcnxG4eqJc70=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
View all headers

jak <nospam@please.ty> wrote or quoted:
>complex, I happen to use Google-Translator. It makes bad translations if
>the lines are interrupted by the newline, so I wrote a tool dedicated to
>Stefan and to all those who indent like him. This tool takes the text
>from the clipboard, removes all the superfluous spaces, combines all the
>lines in one and puts the result back into the clipboard. :-D

The game-changer is using "Content-Type: text/plain" instead
of "Content-Type: text/plain; format=flowed", because some
translation services are gonna interpret line breaks as
paragraph endings! But extra spaces like this should
just get ignored by most translation services.

We usually set off quotes, like code snippets, by indenting them.
Well, that won't fly in Python because indentation actually affects
the code's meaning. That's why in Python newsgroups, we got to do the
opposite - indent the surrounding text to make the quotes stand out!

Subject: Re: Python Dialogs
From: Stefan Ram
Newsgroups: comp.lang.python
Organization: Stefan Ram
Date: Mon, 6 May 2024 13:07 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: 6 May 2024 13:07:55 GMT
Organization: Stefan Ram
Lines: 19
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <gonna-20240506140618@ram.dialup.fu-berlin.de>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de> <87frv02sg1.fsf@zedat.fu-berlin.de> <v1acge$2h0qo$1@dont-email.me> <spaces-20240506123628@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Ta16+rwNNrVZraiaayoLIgXDOTQpxj8JOK/Jq3Pj9Xz24R
Cancel-Lock: sha1:h+uVHP/xPKX6Ru/Bp47HTnP/0Qo= sha256:+CW2sF5KYdSqnguxRtt5PtBHojzS+ACfiv9wSgECstc=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
View all headers

ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
>translation services are gonna interpret line breaks as

I just beefed up my posting program to replace "gonna".

Now I won't come across like some street thug, but rather
as a respectable member of human society!

# replace complete words
replacements =\
{ rb'kind of': b'kind of',
rb'trying to': b'trying to',
rb'got to': b'got to',
rb'gonna': b'going to',
}
lines =\
[ re.sub( rb"\b(" + b"|".join( replacements.keys() ) + rb")\b",
lambda x: replacements[ x.group() ], line )
if len( line )and line[ 0 ]not in b'>|' else line for line in lines ]

Subject: Re: Python Dialogs
From: jak
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Mon, 6 May 2024 14:15 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@please.ty (jak)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: Mon, 6 May 2024 16:15:41 +0200
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <v1aomd$2jsbp$1@dont-email.me>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de> <v1acge$2h0qo$1@dont-email.me>
<spaces-20240506123628@ram.dialup.fu-berlin.de>
<gonna-20240506140618@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 06 May 2024 16:15:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fa2dbc4125fee46b801fdffab1560af6";
logging-data="2748793"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18E48EzOuwgXFbRHiPED4FU"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.2
Cancel-Lock: sha1:tfXRerk57gr6RRJKp358Qnf87hE=
In-Reply-To: <gonna-20240506140618@ram.dialup.fu-berlin.de>
View all headers

Stefan Ram ha scritto:
> ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
>> translation services are gonna interpret line breaks as
>
> I just beefed up my posting program to replace "gonna".
>
> Now I won't come across like some street thug, but rather
> as a respectable member of human society!
>
> # replace complete words
> replacements =\
> { rb'kind of': b'kind of',
> rb'trying to': b'trying to',
> rb'got to': b'got to',
> rb'gonna': b'going to',
> }
> lines =\
> [ re.sub( rb"\b(" + b"|".join( replacements.keys() ) + rb")\b",
> lambda x: replacements[ x.group() ], line )
> if len( line )and line[ 0 ]not in b'>|' else line for line in lines ]
>

I present to you the brutality to which your posts are subjected:

for(d = s = pCLipb; *s != TEXT('\0'); s++)
{
if(d == pCLipb)
{
if(*s != TEXT(' ') && *s != TEXT('\n') && *s != TEXT('\r'))
*d++ = *s;
}
else if(*s == TEXT(' ') || *s == TEXT('\n') || *s == TEXT('\r'))
{
if(d[-1] != TEXT(' '))
*d++ = TEXT(' ');
}
else
*d++ = *s;
}
*d = TEXT('\0');

Subject: Re: Python Dialogs
From: Chris Angelico
Newsgroups: comp.lang.python
Date: Mon, 6 May 2024 17:48 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs
Date: Tue, 7 May 2024 03:48:19 +1000
Lines: 29
Message-ID: <mailman.11.1715017712.3326.python-list@python.org>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de> <v1acge$2h0qo$1@dont-email.me>
<CAPTjJmq00N_zrP22VGJvhju8S8uvH+aQQZgD9Sx=2O9pr2VQzQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 3itE1grWi8HfarDHtscwiQfJZULstXRiGDgHEry82+/Q==
Cancel-Lock: sha1:2ooMECqE72g0W0MZzBGksLOrOTU= sha256:kE0sZWt7JfW8gt3MXkDVVOBQxnbGBifLxJjQZsz/LrU=
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=VzaSP7zu;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.027
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; ':-)': 0.09;
'translations': 0.09; 'writes:': 0.09; 'subject:Python': 0.12;
'problem.': 0.15; '2024': 0.16; 'bennett': 0.16; 'chrisa': 0.16;
'combines': 0.16; 'contrary': 0.16; 'from:addr:rosuav': 0.16;
'from:name:chris angelico': 0.16; 'interrupted': 0.16; 'removes':
0.16; 'wrote:': 0.16; 'problem': 0.16; 'tue,': 0.19; 'to:addr
:python-list': 0.20; 'i.e.': 0.22; 'lines': 0.23; 'stuff': 0.25;
'stefan': 0.26; 'folks': 0.28; 'seem': 0.31; 'takes': 0.31;
'think': 0.32; 'guess': 0.32; 'python-list': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'mailing': 0.33; 'there':
0.33; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'particularly': 0.35; 'from:addr:gmail.com': 0.35; 'posts': 0.36;
'people': 0.36; 'those': 0.36; "it's": 0.37; 'text': 0.39; 'list':
0.39; 'use': 0.39; 'wrote': 0.39; 'happen': 0.40; 'follow': 0.62;
'your': 0.64; 'his': 0.65; 'dedicated': 0.65; 'tool': 0.65;
'back': 0.67; 'bad': 0.67; 'brain,': 0.84; 'dispute': 0.84;
'texts': 0.91; 'blocked': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1715017710; x=1715622510; darn=python.org;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=ywYKQ+8VTzCdiFsa/EyGiI3psbRl9QWCuVgodf3AcgU=;
b=VzaSP7zuNS+W1Fr3OhUuMZQIhfyeC1mCbAK9VHIeoG93ngs0TMTOCyc4cOrY8ulbfg
CJJ7fxRW5w9XAHP82p41p0MlnQsqSLLyXn1ljPLZ7uPY7WG1bHyBK0xIgQwv0Vm0hPxg
OEC4Fl5d/7GxhIZwZD3e3M0CROA2JjDUHLz6r/2ew5pP6c/prwIVlZK1wNEDdhCKfmR9
XONXEBG/yxe4pZyLrVLQewezm1r4OXQfOF/iV/g0B8g2LCerOIw5TgQQGarmW5FJ2DSr
EwoDRl5jRXDnOFM7AduK6WuYkB+8LApCOhJGB9C8J6Iws2snapMwmAEi73OOuiRxE+v3
T2vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1715017710; x=1715622510;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=ywYKQ+8VTzCdiFsa/EyGiI3psbRl9QWCuVgodf3AcgU=;
b=PeyzyEmiVPnmGWdc8YZNmuWHid0jONi/0rtT/7LfhLQLtCHLLuI1UJL0Nmnbg9G9M0
sFVOq/0246qn+e0PGwTimCJoL+eJcckrmoEaszs04+8r9GuRGRD1oC9StvLDcenjyhqD
G/vyGuVt7HQfV23JBODCs03QBSlWRRUJ8OP9nwlOkwGs9wIoLseQ6EMGCR7ufNx7VHpg
qbNd7UaUS6CIIucDu7c+w2J89ZSHXcxT1vD2kcXsrn1hHpnmFXzlBUo3mKViqLTNWFy4
O9Ig+ovJXko6fVUMk/UwTLHlgeVwrlnxPizcr8qFdRgYR5lMAAg4krJLVucKSOamS6TA
tgCg==
X-Gm-Message-State: AOJu0Yx3S7eM8sQISjdlQnYfHaBhHig6u6rDW2oJn/GLUHHP6uz7yh5+
gWHtrQ+4lBoyA+PUfAwOzsqrcy05AvkSixcBddFeL1k4ylfysJKkIf+5K45CsevSrPKw++fYlzA
Ku9oGnQRJua2vUhdyIDALJl0rFUUFLA==
X-Google-Smtp-Source: AGHT+IFUiiN4XeIOeEB9KhNTfNWCIZPzucVLKz9uxKPErflKK92TWhdLTTJgD5bfzSoFSw5f4YrUZokkucMsEkDtsoo=
X-Received: by 2002:a05:651c:1a0f:b0:2d9:f7f8:3e87 with SMTP id
by15-20020a05651c1a0f00b002d9f7f83e87mr8801928ljb.32.1715017710264; Mon, 06
May 2024 10:48:30 -0700 (PDT)
In-Reply-To: <v1acge$2h0qo$1@dont-email.me>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmq00N_zrP22VGJvhju8S8uvH+aQQZgD9Sx=2O9pr2VQzQ@mail.gmail.com>
X-Mailman-Original-References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de> <v1acge$2h0qo$1@dont-email.me>
View all headers

On Tue, 7 May 2024 at 03:42, jak via Python-list <python-list@python.org> wrote:
>
> Loris Bennett ha scritto:
> > ram@zedat.fu-berlin.de (Stefan Ram) writes:
> >
> >> Me (indented by 2) and the chatbot (flush left). Lines lengths > 72!
> >
> > Is there a name for this kind of indentation, i.e. the stuff you are
> > writing not being flush left? It is sort of contrary to
> > what I think of as "normal" indentation. You seem to use it in all your
> > postings, too, which hurts my brain, but I guess that's my problem :-)
> >
> > [snip (40 lines)]
> >
>
> It's not just your problem. When the texts are particularly long and
> complex, I happen to use Google-Translator. It makes bad translations if
> the lines are interrupted by the newline, so I wrote a tool dedicated to
> Stefan and to all those who indent like him. This tool takes the text
> from the clipboard, removes all the superfluous spaces, combines all the
> lines in one and puts the result back into the clipboard. :-D
>

Fun fact: His posts are completely irrelevant to people who follow the
mailing list. Due to a dispute over permissions, his posts are blocked
at the gateway. So all of us folks who use the mailing list never need
to see the wonky indentation.

ChrisA

Subject: Re: Python Dialogs (Posting On Python-List Prohibited)
From: Lawrence D'Oliv
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Mon, 6 May 2024 21:42 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: Python Dialogs (Posting On Python-List Prohibited)
Date: Mon, 6 May 2024 21:42:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v1bisr$2q1db$2@dont-email.me>
References: <dialog-20240502150909@ram.dialup.fu-berlin.de>
<87frv02sg1.fsf@zedat.fu-berlin.de> <v1acge$2h0qo$1@dont-email.me>
<spaces-20240506123628@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 06 May 2024 23:42:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="dc1d33da74917bfc47081f50e6ae0383";
logging-data="2950571"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189IxBVFFI/I7INNGVDIFOQ"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Ijx0w4KO2yVJSmQSm6h749wAWqY=
View all headers

On 6 May 2024 11:43:01 GMT, Stefan Ram wrote:

> Well, that won't fly in Python because indentation actually affects
> the code's meaning.

This is another reason why I use “#end” comments. Even if the indentation
gets screwed up, it is still possible to reconstruct what it means.
Otherwise, the code would just become irretrievable gibberish.

1

rocksolid light 0.9.8
clearnet tor