Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )

2024-06-14 Thread candycanearter07 via Python-list
Phil Carmody  wrote at 12:01 this Thursday (GMT):
> Paul Rubin  writes:
>> HenHanna  writes:
>>> is there another (simple) way to write this?
>>
>> Yes, but please consider doing these easy exercises yourself instead of
>> fobbing them onto other people.
>
> Hen's probably just an experimental GPT. You, with your limited
> resources, can never train it.
>
> I'd say you can't beat the verbosity, or lack thereof of just plain zsh/bash:
>   $ echo {1,2,3,4}0{1,2,3}
>   101 102 103 201 202 203 301 302 303 401 402 403
>
> Phil


I /think/ you can replace it with {1...4} and {1...3}? I know there is
some syntax for "range of numbers" but I can't remember it exactly.
-- 
user  is generated from /dev/urandom
-- 
https://mail.python.org/mailman/listinfo/python-list


Anonymous email users

2024-06-14 Thread AVI GROSS via Python-list
I notice that in some recent discussions, we have users who cannot be
replied to directly as their email addresses are not valid ones, and I
believe on purpose. Examples in the thread I was going to reply to are:
 
  [email protected]
 
  [email protected]
 
 
[email protected] (user  is
generated from /dev/urandom)
 
I know some here suggest that we only reply to the wider community and they
have a point. But I think there is a role for having some conversations
offline and especially when they are not likely to be wanted, or even
tolerated, by many in the community.
 
Using such fake or invalid emails makes it hard to answer the person
directly or perhaps politely ask them for more info on their request or
discuss unrelated common interests. Worse, when I reply, unless I use
reply-all, my mailer sends to them futilely. When I do the reply-all, I have
to edit out their name or get a rejection.
 
I understand some are concerned over getting email of the junk variety by
any who scan members of forums like this. I can see making a throwaway email
address for such purposes that can be replaced when it gets inundated. But
emails that don't work are a bit irksome to me albeit I assume perfectly
legit for many purposes.
 
The thread I posted in recently is an example where I spent a little time,
just for fun, and wrote a fairly short piece of code (almost a one-liner)
that I might have sent to the OP and not bothered others here with. I
suspect few here understand why there was a request to generate a limited
subset of three-digit numbers. I did suggest an outline of a way it could be
done, perhaps a bit wastefully but compactly. But there is no way to share
that with people who choose not to receive private email except to post
something like this here:
 
import re
[i for i in range(999) if re.match("^[1-4]0[1-3]$",str(i))]
 
*   The internet is a wild place and when it is anonymous, even wilder.
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Anonymous email users

2024-06-14 Thread dn via Python-list

On 15/06/24 10:00, AVI GROSS via Python-list wrote:

I notice that in some recent discussions, we have users who cannot be
replied to directly as their email addresses are not valid ones, and I
believe on purpose. Examples in the thread I was going to reply to are:

...

It's an interesting conundrum. There are good reasons and nefarious, for 
such behavior.


Some have questioned my behavior in similar regard - asking why I use 
initials (also used IRL). It is because my first name "David" is/was 
very popular. At a meeting this week there were three of us. Thus, 
"David", "Dave", and "dn" was necessary to distinguish between us.



These mailing-lists all run under the Python Code of Conduct.

This also effects a conundrum. Firstly, that someone abusing others (for 
example) shall be held responsible. Secondly, that in order to hold 
someone responsible, he/she/... must be identifiable.



Personal opinion: if someone is asked a 
question/clarification/sample-code, particularly as a response to their 
own OP, and does not answer; this is at the least rude, and thus 
disrespectful, or at worst grounds for not bothering with them again - 
hardly a 'community' attitude!


--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Anonymous email users

2024-06-14 Thread Chris Angelico via Python-list
On Sat, 15 Jun 2024 at 08:32, dn via Python-list  wrote:
> These mailing-lists all run under the Python Code of Conduct.
>

The newsgroup, however, is not. Which means that anyone who posts on
the newsgroup is subject to no such restrictions - and that might
explain the, shall we say, quite different signal-to-noise ratio of
newsgroup posters compared to mailing list posters.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Anonymous email users

2024-06-14 Thread Cameron Simpson via Python-list

On 14Jun2024 18:00, [email protected]  wrote:

I notice that in some recent discussions, we have users who cannot be
replied to directly as their email addresses are not valid ones, and I
believe on purpose. Examples in the thread I was going to reply to are:

 [email protected]

[...]
I know some here suggest that we only reply to the wider community and 
they

have a point. But I think there is a role for having some conversations
offline and especially when they are not likely to be wanted, or even
tolerated, by many in the community.

Using such fake or invalid emails makes it hard to answer the person
directly or perhaps politely ask them for more info on their request or
discuss unrelated common interests. Worse, when I reply, unless I use
reply-all, my mailer sends to them futilely. When I do the reply-all, I have
to edit out their name or get a rejection.


I often reply-all (meaning to the list and to the author). And edit the 
headers (frankly, often just to discard anything @gmail.com which has 
very stupid spam poolicies).  If I miss an @invalid.com or whatever, 
then whoops.


If I want to reply directly (eg for some kind of feedback rather than a 
list type reply) and they've got a bogus address, well then I don't.  
Supposedly my reply would be of benefit for them or I shouldn't be doing 
it, so their loss. But equally, if they don't want personal off-list 
contact, they've expressed their preference. I should respect that.


Plenty of people have reasons to post anonymously, even to a list like 
this one. Just assume they've got their reasons and move on.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Suggested python feature: allowing except in context maneger

2024-06-14 Thread Cameron Simpson via Python-list

On 14Jun2024 09:07, Yair Eshel  wrote:

Cameron, I'm not really sure I got your point. I've used the "file not
found" exception as an example for a behavior typical on context managers.
This could be a failure to connect to DB, or threads. It also applies to
any kind of possible exception, whether cased by the context manager itself
or the lines inside it. Long story short, this syntax change is as useful
as context managers are


The example exception is not what bothers me. The syntax change is 
nowhere near as useful as `with` and context managers. They provide an 
excellent idiom for resource usage and release.


Your suggestion complicates the `with` statement and brings only a tiny 
indentation reduction over the `with`-inside-`try` idiom. It brings no 
semantic changes or new features.


That is why I'm -1: the benefit is triviailly small to my eye.
--
https://mail.python.org/mailman/listinfo/python-list