[Python-Dev] Re: A proposal to modify `None` so that it hashes to a constant

2022-12-11 Thread Rob Cliffe via Python-Dev

You are absolutely right, of course.  It was a wild idea, and a bad one.
I find myself moving towards supporting the OP.  I can't see anything 
terrible about the hash of None always being 0, or perhaps better some 
other arbitrary constant.

Rob

On 04/12/2022 03:20, Steven D'Aprano wrote:

On Thu, Dec 01, 2022 at 10:18:49PM +, Rob Cliffe via Python-Dev wrote:


Wild suggestion:
     Make None.__hash__ writable.
E.g.
     None.__hash__ = lambda : 0 # Currently raises AttributeError:
'NoneType' object attribute '__hash__' is read-only

You would have to write to `type(None).__hash__` because of the way
dunders work.

Now imagine that you have twenty different libraries or functions or
classes, each the `__hash__` method to a different function. Chaos.

You can simulate that chaos with this:

```
import random

class ChangingHash:
 def __repr__(self):
 return "MyNone"
 def __hash__(self):
 # Simulate the effect of many different callers changing
 # the hash value returned at unpredictable times.
 return random.randint(1, 9)

MyNone = ChangingHash()

data = {MyNone: 100}
print(MyNone in data)  # 8 in 9 chance of printing False
data[MyNone] = 200
print(data)  # 8 in 9 chance of {MyNone: 100, MyNone: 200}
print(MyNone in data)  # now 7 in 9 chance of printing False
```




___
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/NKXS4JKYMOTAIMS7D5YY5FSQPBPWZHPA/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Switching to Discourse

2022-12-11 Thread Baptiste Carvello
Le 10/12/2022 à 22:51, Cameron Simpson a écrit :
> 
> In short: copying the Discourse stuff to mailman could be done by
> subscribing the mailman list to the Discourse forum.  Letting
> _nonDiscourse_ users reply or post to Discourse is not trivial.

IMHO it would already be a nice achievement if these two things could be
done:

- subscribe the mailman list to the *relevant parts* of the Discourse
forum; that would be more or less the Core Development and PEP
categories (you must know better than me: is there anything else your
filters let in?)

- let *Discourse users* reply to those list messages from their mail
client with their known-to-Discourse address (is the From address enough
for Discourse to recognize the user?)

Cheers,
Baptiste
___
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/7BKLNTBUYLXY2WONH6AD2L3XMU6AYTGK/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Switching to Discourse

2022-12-11 Thread Tiziano Zito



On Sat 10 Dec, 17:47 +0100, Baptiste Carvello  
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/


[Python-Dev] Re: Switching to Discourse

2022-12-11 Thread Abdur-Rahmaan Janhangeer
If only, fellow list colleagues, I could see only the topics I choose on
Discourse.

The Discourse feels like python-list, python-dev, python-* combined.
I feel cluttered.

If only I could also export the folks using only the mailing list to the
Discourse.

If only Discourse was as easy to search and port as a mail archive.

If Python is a community thing, the discourse is it. But, I fear, crafting
mail
and reading walls of text might become the skills of a bygone age.

On Discourse i miss the simplicity of a medialess, interactionless,
botless, privilegeless,
notificationless, badgeless platform.

But, we must keep up with advances in tech, cope with different ways, cope
with
what most people use. It's the way forward.

Next time, see you at PythonHut in the Metaverse.

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

github 
Mauritius
___
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/JA76LADBRCVDOGPBVCAXPM66QKDBODU7/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Switching to Discourse

2022-12-11 Thread Barry Scott


> On 11 Dec 2022, at 21:05, Abdur-Rahmaan Janhangeer  
> wrote:
> 
> If only, fellow list colleagues, I could see only the topics I choose on 
> Discourse.

Have you tried changing the Preferences for Notifications/Categories?
That would appear to give you the control you are asking for?

Barry

> 
> The Discourse feels like python-list, python-dev, python-* combined. 
> I feel cluttered. 
> 
> If only I could also export the folks using only the mailing list to the 
> Discourse.
> 
> If only Discourse was as easy to search and port as a mail archive.
> 
> If Python is a community thing, the discourse is it. But, I fear, crafting 
> mail
> and reading walls of text might become the skills of a bygone age.
> 
> On Discourse i miss the simplicity of a medialess, interactionless, botless, 
> privilegeless,
> notificationless, badgeless platform.
> 
> But, we must keep up with advances in tech, cope with different ways, cope 
> with
> what most people use. It's the way forward. 
> 
> Next time, see you at PythonHut in the Metaverse.
> 
> Kind Regards,
> 
> Abdur-Rahmaan Janhangeer
> about  | blog 
>  
> github 
> Mauritius
> ___
> 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/JA76LADBRCVDOGPBVCAXPM66QKDBODU7/
> 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/6S22DLDXIDHAM7X2A5MUBUHJOYB2Z3MJ/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Switching to Discourse

2022-12-11 Thread Cameron Simpson

On 11Dec2022 19:50, Tiziano Zito  wrote:

On Sat 10 Dec, 17:47 +0100, Baptiste Carvello  
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.


Until a new category is made.

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.


Otherwise, that sounds like a workable approach.

FYI, a recent post to the Ideas Discourse category has these relevant 
headers:


X-Discourse-Post-Id: 77785
X-Discourse-Topic-Id: 19277
List-ID: Discussions on Python.org | Ideas 
List-Archive: 
https://discuss.python.org/t/expanding-asyncio-support-for-socket-apis/19277

You can filter on List-ID to select a category, which would avoid muting 
a lot of categories.



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.


Discourse formatting is MarkDown, which is at least pretty easy to read.


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.


Yah.

The tricky bit to my mind is that if the flow is just Discourse->Mailman 
then people replying on the mailing list do not get seen by the 
Discourse users.


Cheers,
Cameron Simpson 
___
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/IWFUVVH6J5TV7GZBPFJB55BVJEF6I54M/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Switching to Discourse

2022-12-11 Thread Cameron Simpson

On 12Dec2022 01:05, Abdur-Rahmaan Janhangeer  wrote:

If only, fellow list colleagues, I could see only the topics I choose on
Discourse.


You can mute catgeories. I don't.


The Discourse feels like python-list, python-dev, python-* combined.
I feel cluttered.


Aye. But I filter my inbound email, and can divert things as desired.


On Discourse i miss the simplicity of a medialess, interactionless,
botless, privilegeless,
notificationless, badgeless platform.


I seriously recommend you try the mailing list mode. I use it pretty 
happily, and only hop over to the web forum when someone posts a 
screenshot (which we actively discourage for code snippets) and 
occasional other rare situations.


Cheers,
Cameron Simpson 
___
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/5C64RFHGVCVBEYGNSRROZGK43HJ5MZVU/
Code of Conduct: http://python.org/psf/codeofconduct/