[Python-ideas] constants in Python: Starting simple and gradually adding more features, was: Re: Pattern Matching controversy

2020-11-15 Thread Paul Sokolovsky
Hello, On Mon, 16 Nov 2020 08:39:30 +1100 Steven D'Aprano wrote: [] > > The baseline of my version is much simpler: > > > > # This makes "const" a kind of hard keyword for this module > > from __future__ import const > > > > FOO: const = 1 # obviously, this is constant > Oh, well, To star

[Python-ideas] Re: Use __bytes__ to access buffer-protocol from "user-land"

2020-11-15 Thread Ben Rudiak-Gould
I don't think __bytes__ is necessarily a bad idea, but I want to point out a couple of things you may be unaware of. First, slicing a memoryview object creates a subview, so you can wrap your mmap object in a memoryview and then create slices for each partition, cluster run, etc. without wasting an

[Python-ideas] Use __bytes__ to access buffer-protocol from "user-land"

2020-11-15 Thread phk
I am working on a toolbox for computer-archaeology where old data media are "excavated" and presented on a web-page. (https://github.com/Datamuseum-DK/AutoArchaeologist for anybody who cares). Since these data-media can easily sum tens of gigabytes, mmap and virtual memory is my weapons of choi

[Python-ideas] Re: PEP 634-636: Mapping patterns and extra keys

2020-11-15 Thread 2QdxY4RzWzUUiLuE
On 2020-11-15 at 19:11:15 +1100, Steven D'Aprano wrote: > On Sat, Nov 14, 2020 at 10:17:34PM -0800, Guido van Rossum wrote: > > > It’s a usability issue; mappings are used quite differently than sequences. > > Compare to class patterns rather than sequence patterns. > > I'm keeping an open mind

[Python-ideas] Re: PEP 634-636: Mapping patterns and extra keys

2020-11-15 Thread Steven D'Aprano
On Sat, Nov 14, 2020 at 10:17:34PM -0800, Guido van Rossum wrote: > It’s a usability issue; mappings are used quite differently than sequences. > Compare to class patterns rather than sequence patterns. I'm keeping an open mind on this question, but I think David is right to raise it. I think t