[Python-Dev] Re: Switching to Discourse

2023-01-26 Thread Alex Krupp via Python-Dev
> This does not solve the problem of engaging actively in a discussion, of
course

I just submitted a proposal to create a Discourse plugin to improve the
accuracy of their inbound email parsing, which is something that several
people have complained about in this thread. This would enable two things:

   - Folks who prefer to live in their inbox could continue to do so and
   contribute by just replying to emails. Discourse currently has
   reply-by-email, but it often mangles formatting and/or entirely deletes
   text. Once these issues are fixed, folks who like the current experience
   would be able to just pretend the forum doesn't exist and continue having
   the same experience as they currently have with GNU Mailman.
   - Right now importing the archives from GNU Mailman into Discourse isn't
   realistic for the same reasons; some messages will import correctly, but
   others will be mangled or missing text. This means you would still need to
   maintain the Malman archive as the canonical source of truth. Once fixed,
   not only would the [Python-Dev] archives be searchable within Discourse,
   but they should also rank better in search than they do in their current
   archive.

If this is something you care about (positively or negatively), here is the
exploratory proposal:

https://meta.discourse.org/t/proposed-plugin-to-improve-reply-by-email-accuracy/252944

Any feedback and/or testing would be much appreciated! Right now Discourse
recognizes that this is a problem and is interested in solving it, but
getting it prioritized will require folks to A) speak up saying they want
it done B) test the underlying API to verify that it actually solves the
problem.

Alex

On Sun, Dec 11, 2022 at 1:54 PM Tiziano Zito  wrote:

>
> On Sat 10 Dec, 17:47 +0100, Baptiste Carvello <
> [email protected]> wrote:
> >There is a small catch though: unless I'm mistaken, Discourse won't let
> >you subscribe to just a set of categories, so any filtering has to
> >happen on the Mailman side.
>
> Well, it is actually possible to achieve what you want.
>
> I have set up Discourse in mailing-list mode [1].
>
> By default muted categories are not included in the emails you get in
> mailing list mode.
>
> So, you just need to mute all categories you don't care about. It is a bit
> of work, but it needs to be done only once. To have an almost complete
> equivalent of the topics that were once discussed on python-dev, you can
> just mute every thing except the "Core Development" category. This is the
> setting I am using since a while and I am quite happy with it. You may want
> to unmute the "PEPs" category as well.
>
> Threading info is kept quite nicely, so I read the discourse mail
> notifications as if it were a mailing list and I almost do not see any
> difference. Text is sometimes a bit messy if people heavily use the
> discourse formatting capabilities, but this kind of posts are quite rare in
> my experience.
>
> This does not solve the problem of engaging actively in a discussion, of
> course, but at least for me it is OK to login to discourse if I have to
> post, given that 99.99% of the time I just want to read posts in my mail
> client.
>
> Ciao!
> Tiziano
>
> [1] You can do this while editing your profile preferences, under the
> "Emails" menu
> ___
> Python-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/7ZJWPADSL7BGBZ5Y6BRHP2LDTHQFZ7UV/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 

Alex Krupp
Cell: (607) 351 2671

Read my Email: www.fwdeveryone.com/u/alex3917
Subscribe to my blog: https://alexkrupp.typepad.com/
My homepage: www.alexkrupp.com
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/Y3BO5TBIM2YQXWCQ4D4RPOBBIDVHNXAL/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Feature Suggestion: "repeat" statement in loops

2023-01-26 Thread Thomas Ratzke

Hi all,

i would like to suggest the following Python feature. It naturally 
happens that one want's to repeat the current iteration of a for loop 
for example after an error happened. For this purpose, I usually set a 
flag and put a while loop inside my for loop. A simple "repeat" 
statement just like "continue" or "break" would make the code much more 
readable.



This is my solution at the moment with A being checked:

for _ in range(n):
    flag = True
    while flag:
        ...
        if A:
            flag = False # go to next iteration


I would suggest the repeat statement in the following sense

for _ in range(n):
    ...
    if not A:
        repeat # repeat current iteration

Notice the "not" in the if clause. I am really looking forwars to hear 
your opinions.


Best regards
Thomas

___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/LNER4MH6IT6HBFKFVTUOJ225PTCZSRRC/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Feature Suggestion: "repeat" statement in loops

2023-01-26 Thread Joao S. O. Bueno
I don't think this will fly - if not for any other reason, it is a very
rare pattern
to take place alongside such important flow-control statements as
continue and break

But for your convenience, here is a small wrapper that, along with the
walrus operator, could be used when you need that functionality:

```
class Repeatable:
def __init__(self, it):
self.it = it
self.repeat_last = False
self.last_item = None
def repeat(self):
self.repeat_last = True
def __iter__(self):
for item in self.it:
while self.repeat_last:
self.repeat_last = False
yield self.last_item
self.last_item = item
yield item


test = 1
for x in (rx:=Repeatable(range(3))):
print(x)
if x == test:
test = -1
rx.repeat()
```

On Thu, Jan 26, 2023 at 4:41 PM Thomas Ratzke 
wrote:

> Hi all,
>
> i would like to suggest the following Python feature. It naturally
> happens that one want's to repeat the current iteration of a for loop
> for example after an error happened. For this purpose, I usually set a
> flag and put a while loop inside my for loop. A simple "repeat"
> statement just like "continue" or "break" would make the code much more
> readable.
>
>
> This is my solution at the moment with A being checked:
>
> for _ in range(n):
>  flag = True
>  while flag:
>  ...
>  if A:
>  flag = False # go to next iteration
>
>
> I would suggest the repeat statement in the following sense
>
> for _ in range(n):
>  ...
>  if not A:
>  repeat # repeat current iteration
>
> Notice the "not" in the if clause. I am really looking forwars to hear
> your opinions.
>
> Best regards
> Thomas
>
> ___
> Python-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/LNER4MH6IT6HBFKFVTUOJ225PTCZSRRC/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/WWEJQD7IIPNC4FUSPHLXEH7SVN6EVK6H/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Feature Suggestion: "repeat" statement in loops

2023-01-26 Thread Chris Angelico
On Fri, 27 Jan 2023 at 06:42, Thomas Ratzke  wrote:
>
> Hi all,
>
> i would like to suggest the following Python feature. It naturally
> happens that one want's to repeat the current iteration of a for loop
> for example after an error happened. For this purpose, I usually set a
> flag and put a while loop inside my for loop. A simple "repeat"
> statement just like "continue" or "break" would make the code much more
> readable.
>
>
> This is my solution at the moment with A being checked:
>
> for _ in range(n):
>  flag = True
>  while flag:
>  ...
>  if A:
>  flag = False # go to next iteration
>

Why not use break?

ChrisA
___
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/BG3DUXYTZLMZAO3UK545C5YXNY3AA3VA/
Code of Conduct: http://python.org/psf/codeofconduct/