Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-03-16 Thread 황병희
Dear Loris, "Loris Bennett" writes: > (...thanks...) > The sysadmins I know who are interested in long-term stability and > avoiding unnecessary OS updates use Debian rather than Ubuntu, +1; Reasonable! Sincerely, Linux fan Byung-Hee -- ^고맙습니다 _地平天成_ 감사합니다_^))// -- https://mail.python.org/m

Re: Best practice for caching hash

2022-03-16 Thread Cameron Simpson
On 16Mar2022 14:00, Marco Sulla wrote: >On Wed, 16 Mar 2022 at 00:42, Cameron Simpson wrote: >> >In this case I currently cache the value -1. The subsequent calls to >> >__hash__() will check if the value is -1. If so, a TypeError is >> >immediately raised. >> >> This will also make these values

Re: Best practice for caching hash

2022-03-16 Thread Marco Sulla
On Wed, 16 Mar 2022 at 09:11, Chris Angelico wrote: > Caching the hash of a > string is very useful; caching the hash of a tuple, not so much; again > quoting from the CPython source code: > > /* Tests have shown that it's not worth to cache the hash value, see >https://bugs.python.org/issue96

Re: basic question on loop & type casting / list/str/array

2022-03-16 Thread Python
Kiran Kumar wrote: Hi. Pls check on below poython 3.9.x code & suggest how can i keep the string intactst in 2nd loop... ? these are aws ec2 ids Don't loop through it then. -- https://mail.python.org/mailman/listinfo/python-list

basic question on loop & type casting / list/str/array

2022-03-16 Thread Kiran Kumar
Hi. Pls check on below poython 3.9.x code & suggest how can i keep the string intactst in 2nd loop... ? these are aws ec2 ids >>> INSTANCE_ID = ['i-0dccf1ede229ce1','i-0285506fee62051'] >>> for i in INSTANCE_ID: ... print (i) ... i-0dccf1ede229ce1 i-0285506fee62051 >>> >>> >>> >>> for i in IN

Re: Best practice for caching hash

2022-03-16 Thread Greg Ewing
On 16/03/22 6:58 pm, Chris Angelico wrote: And Python's own integers hash to themselves, > which isn't what I'd call "widely distributed", but which > works well in practice. Not exactly, they seem to be limited to 60 bits: >>> hex(hash(0xfff)) '0xfff' >>> hex(hash(0x1f

Re: Best practice for caching hash

2022-03-16 Thread Marco Sulla
On Wed, 16 Mar 2022 at 00:59, Chris Angelico wrote: > > (Though it's a little confusing; a frozendict has to have nothing but > immutable objects, yet it permits them to be unhashable? It can have mutable objects. For example, a key k can have a list v as value. You can modify v, but you can't as

[RELEASE] Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 are now available with security content

2022-03-16 Thread Łukasz Langa
Welcome again to the exciting world of releasing new Python versions! Last time around I was complaining about cursed releases . This time around I could complain about security content galore and how one of

Re: Reportlab / platypus bug?

2022-03-16 Thread Les
Greg Ewing ezt írta (időpont: 2022. márc. 16., Sze, 1:01): > On 16/03/22 2:20 am, Les wrote: > > I tried to subscribe (twice), but never got the confirmation > > email. Checked in the spam folder too, but it is nowhere to be found. > > Is there any chance your email provider has some kind of quar

Re: Best practice for caching hash

2022-03-16 Thread Marco Sulla
On Wed, 16 Mar 2022 at 00:42, Cameron Simpson wrote: > > Is it sensible to compute the hash only from the immutable parts? > Bearing in mind that usually you need an equality function as well and > it may have the same stability issues. [...] > In that case I would be inclined to never raise Typ

Re: Best practice for caching hash

2022-03-16 Thread Cameron Simpson
On 16Mar2022 19:09, Chris Angelico wrote: >On Wed, 16 Mar 2022 at 18:48, Cameron Simpson wrote: >> This may be because the "raw" hash (in this case the int value) is >> itself further hashed (giving more evenness) and then moduloed into the >> finite number of slots in the dict. > >Not in a CPyth

Re: Best practice for caching hash

2022-03-16 Thread Chris Angelico
On Wed, 16 Mar 2022 at 18:48, Cameron Simpson wrote: > > On 16Mar2022 16:58, Chris Angelico wrote: > >On Wed, 16 Mar 2022 at 14:00, Cameron Simpson wrote: > >> On 16Mar2022 10:57, Chris Angelico wrote: > >> A significant difference is that tuples have no keys, unlike a dict. > >> > >> A hash do

Re: Best practice for caching hash

2022-03-16 Thread Cameron Simpson
On 16Mar2022 16:58, Chris Angelico wrote: >On Wed, 16 Mar 2022 at 14:00, Cameron Simpson wrote: >> On 16Mar2022 10:57, Chris Angelico wrote: >> A significant difference is that tuples have no keys, unlike a dict. >> >> A hash does not have to hash all the internal state, ony the relevant >> stat