[Python-Dev] Re: Revive PEP 396 -- Module Version Numbers ?

2021-04-15 Thread David Mertz
On Thu, Apr 15, 2021 at 4:55 PM Christopher Barker wrote: > Presumably that's why importlib.metadata exists in the stdlib. > I was so hopeful about this, but in the end... not really. I have not used this capability before. Here are a few different situations I know of: >>> import re, statist

[Python-Dev] Re: Revive PEP 396 -- Module Version Numbers ?

2021-04-15 Thread David Mertz
On Thu, Apr 15, 2021 at 9:54 PM Christopher Barker wrote: > Or rather, the below is what I would find really nice to be able to do. > >> ver = robust_version(module) >> if ver >= (5, 2, 1): >> doit_modern_style() >> elif ver < (5, 2, 1): >> doit_old_style >> else: >> doit_unversioned_

[Python-Dev] Re: Anyone else gotten bizarre personal replies to mailing list posts?

2021-04-23 Thread David Mertz
This reads like a much worse variation on GPT-3. On Fri, Apr 23, 2021, 11:52 AM Pablo Galindo Salgado wrote: > I had I and still don't know what's going on. Mine was in a response to a > release announcement so it was extra weird. Here is what I received: > > I have now formally filed a final la

[Python-Dev] Re: In what tense should the changelog be written?

2021-04-30 Thread David Mertz
A lot of times the present tense in changelogs and similar is the English "historical present", also called "narrative present." When the verb comes first, it is usually imperative, but these shade with context. E.g. * Give class Froz a .bar() method * Adding metaclass gives class Froz a .bar() me

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread David Mertz
On Thu, May 13, 2021 at 10:31 PM Christopher Barker wrote: > There was a discussion a while back ( a year or so?? ) on Python-ideas > that introduced the idea of having more "sentinel-like" singletons in > Python -- right now, we only have None. > As I remember, the year-ago conversation was bas

[Python-Dev] Re: The repr of a sentinel

2021-05-14 Thread David Mertz
I think it's more future-looking to allow pickle round-tripping. Just add a ._uuid attribute and have object equality follow equality of that attribute. There's no reason to expose that in the .__repr__, but it would be inspectable in concept. On Fri, May 14, 2021, 7:01 PM Irit Katriel via Python-

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread David Mertz
On Thu, May 20, 2021 at 6:21 AM Tal Einat wrote: > On Sat, May 15, 2021 at 2:09 AM David Mertz wrote: > > Just add a ._uuid attribute and have object equality follow equality of > that attribute. There's no reason to expose that in the .__repr__, but it > would be inspectab

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread David Mertz
On Thu, May 20, 2021, 2:11 PM Chris Angelico > Probably the easiest way would be to have some kind of unique > identifier (a fully-qualified name) that can be pickled, and then any > time you attempt to construct a Sentinel with that identifier, it's > guaranteed to return the same object. Gosh,

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread David Mertz
On Thu, May 20, 2021 at 3:03 PM Ethan Furman wrote: > > But it nevertheless feels like a bit of an abuse - the original point > > of ellipsis was for indexing, and in particular complex slices like > > a[1:20:2, ..., 3:5]. That usage is common in numpy, as I understand > > it, > Interesting -

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread David Mertz
813968 It would be pleasant if there were a way to make "cheap_sentinel" be the same thing—either by equality or by identity—betweeen those two runs of the interpreter. None or Ellipsis have that property, of course. So do, for example, integers, at least by equality if not identity (yes,

[Python-Dev] Re: Roundup to GitHub Issues migration

2021-06-22 Thread David Mertz
This is perhaps a different issue, but perhaps not. PSF grants are also subject to absurd and convoluted (and difficult to interpret) "export control" rules. Also rules subject to change at any moment at the whims of the latest US government grandstanding. USA incorporation definitely has drawback

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-10 Thread David Mertz
This is fairly academic, since I do not anticipate needing to do this myself, but I have a specific question. I'll assume that Python 3.5.2 will go back to the 2.6-3.4 behavior in which os.urandom() never blocks on Linux. Moreover, I understand that the case where the insecure bits might be retur

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-10 Thread David Mertz
On Fri, Jun 10, 2016 at 11:33 AM, Donald Stufft wrote: > > On Jun 10, 2016, at 2:29 PM, David Mertz wrote: > > If I *were* someone who needed to write a Linux system initialization > script using Python 3.5.2, what would the code look like. I think for this > use case, requiri

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-10 Thread David Mertz
use of your application” behavior. > > So really, out of the recommended solutions you really only have find a > way to interface with the getrandom() function, or just consume > /dev/urandom and hope it’s been initialized. > > > On Jun 10, 2016, at 2:43 PM, David Mertz wrote: > &g

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-10 Thread David Mertz
I believe that secrets.token_bytes() and secrets.SystemRandom() should be changed even for 3.5.1 to use getrandom() on Linux. Thanks for fixing my spelling of the secrets API, Donald. :-) On Fri, Jun 10, 2016 at 12:17 PM, Donald Stufft wrote: > > On Jun 10, 2016, at 3:05 PM, David Mertz

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-10 Thread David Mertz
Ooops thinko there! Of course `secrets` won't exist in 3.5.1, so that's a 3.6 matter instead. On Fri, Jun 10, 2016 at 12:29 PM, David Mertz wrote: > I believe that secrets.token_bytes() and secrets.SystemRandom() should be > changed even for 3.5.1 to use getrandom() on Linux

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-10 Thread David Mertz
On Fri, Jun 10, 2016 at 12:55 PM, Larry Hastings wrote: > On 06/10/2016 12:29 PM, David Mertz wrote: > > I believe that secrets.token_bytes() and secrets.SystemRandom() should be > changed even for 3.5.1 to use getrandom() on Linux. > > Surely you meant 3.5.2? 3.5.1 shi

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-16 Thread David Mertz
On Thu, Jun 16, 2016 at 11:58 AM, Nathaniel Smith wrote: > [...] no one else be able to predict what session cookie I sent [...] In > python 2.3-3.5, the most correct way to write this code is to use > os.urandom. The question in this thread is whether we should break that in > 3.6, so that consc

Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016-06-16 Thread David Mertz
on that someone stick on Python 2.7 or 3.3 shouldn't be able to include the future-style: import secrets Answer = secrets.token_bytes(42) On Jun 16, 2016 4:53 PM, "Nick Coghlan" wrote: > On 16 June 2016 at 13:09, Barry Warsaw wrote: > > On Jun 16, 2016, at 01:01 PM, David M

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-09 Thread David Mertz
It seems unlikely, but not inconceivable, that someday in the future someone will implement a dictionary that is faster than current versions but at the cost of losing inherent ordering. It feels best to me only to promise order in specific cases like kwargs, but say nothing (even in 3.6 or 3.7) a

Re: [Python-Dev] Someons's put a "Python 2.8" on GitHub

2016-12-10 Thread David Mertz
I'm forwarding this to the PSF Trademarks committee. If there is a violation, it's a misuse of trademark, not copyright on the code which has the Python license stack. I'm on that committee and agree this is improper use. Let's see what other members think. On Dec 10, 2016 12:19 AM, "Barry Warsaw

Re: [Python-Dev] Someons's put a "Python 2.8" on GitHub

2016-12-10 Thread David Mertz
I am more worried about the confusion than Guido is. I agree that this will remain a toy project. But as someone who trains scientist to use Python and consults with large companies with large Python 2 codebases, I think the very existence of a thing called "Python 2.8" will serve as a pretext for

Re: [Python-Dev] Someons's put a "Python 2.8" on GitHub

2016-12-10 Thread David Mertz
On Dec 10, 2016 10:42 AM, "Wes Turner" wrote: and this is on purpose, since Python is BSD software which > anyone can use, modify, fork, etc. > So, otherwise everyone who forks for any reason is in violation of the trademark policy? The trademark issue has nothing to do with the code copyright

Re: [Python-Dev] Translated Python documentation

2017-02-26 Thread David Mertz
Could we have side-by-side English and whatever translated language? Then also use some sort of typographic indicator like color to show when the translation is out of date? On Feb 26, 2017 6:39 PM, "Rob Cliffe" wrote: > > > On 24/02/2017 12:20, Berker Peksağ wrote: > >> On Thu, Feb 23, 2017 at

Re: [Python-Dev] Translated Python documentation

2017-02-27 Thread David Mertz
On Sun, Feb 26, 2017 at 11:30 PM, Nick Coghlan wrote: > On 27 February 2017 at 14:03, David Mertz wrote: > >> Could we have side-by-side English and whatever translated language? Then >> also use some sort of typographic indicator like color to show when the >> tr

Re: [Python-Dev] Aligning the packaging.python.org theme with the rest of the docs

2017-05-28 Thread David Mertz
I agree with MAL and have also been on the Trademarks Committee for 8-9 years. Protecting an actual Mark like the logo is fine, as painful as it is to someone's say no to an attractive derived logo. But trying to protect a look-and-feel is way too far down the path of evil (it's what some proprieta

Re: [Python-Dev] Aligning the packaging.python.org theme with the rest of the docs

2017-05-29 Thread David Mertz
This is a side issue, do I don't want to go too​ long with it. But *NO* we can't always give permission. The problem isn't how permissive PSF might like to be in the abstract, but trademark law itself. Trademark is "enforce it or lose it" ... Even passively allowing dilutive derivatives would cause

Re: [Python-Dev] Python startup time

2017-07-21 Thread David Mertz
How implausible is it to write out the actual memory image of a loaded Python process? I.e. on a specific machine, OS, Python version, etc? This can only be overhead initially, of course, but on subsequent runs it's just one memory map, which the cheapest possible operation. E.g. $ python3.7 --wr

Re: [Python-Dev] Python startup time

2017-07-21 Thread David Mertz
I would guess that Windows users don't tend to run lots of command line tools where startup time dominates, as *nix users do. On Fri, Jul 21, 2017 at 3:21 PM, Barry Warsaw wrote: > On Jul 21, 2017, at 01:25 PM, Nikolaus Rath wrote: > > >That is what Emacs does, and it causes them a lot of troubl

Re: [Python-Dev] PEP 550 v4

2017-08-25 Thread David Mertz
This is now looking really good and I can understands it. One question though. Sometimes creation of a context variable is done with a name argument, other times not. E.g. var1 = new_context_var('var1') var = new_context_var() The signature is given as: sys.new_context_var(name: str) But

Re: [Python-Dev] PEP 550 v4

2017-08-26 Thread David Mertz
Would it be possible/desirable to make the default a unique string value like a UUID or a stringified counter? On Aug 26, 2017 9:35 AM, "Yury Selivanov" wrote: On Sat, Aug 26, 2017 at 12:56 AM, David Mertz wrote: > This is now looking really good and I can understands it. Gr

Re: [Python-Dev] PEP 550 v4

2017-08-26 Thread David Mertz
I'm convinced by the new section explaining why a single value is better than a namespace. Nonetheless, it would feel more "Pythonic" to me to create a property `ContextVariable.val` whose getter and setter was `.lookup()` and `.set()` (or maybe `._lookup()` and `._set()`). Lookup might require a

Re: [Python-Dev] Complex numbers

2017-09-04 Thread David Mertz
This sounds like something worthwhile to put on GitHub and PyPI. But it doesn't seem like it has much to do with developing CPython itself, the purpose of this list. On Sep 4, 2017 2:09 PM, "TBER Abdelmalek" wrote: > This module implements cplx class (complex numbers) regardless to the > built-i

[Python-Dev] Re: Please be more precise when commenting on PEP 611.

2019-12-09 Thread David Mertz
I have not seen any benchmarks supporting the claim that proposed limits would ACTUALLY have any positive performance effect. While some of the claims of performance gain are *plausible*, I also would not be very surprised if some of them caused performance loss. For example, requiring bit masking

[Python-Dev] Re: Please be more precise when commenting on PEP 611.

2019-12-09 Thread David Mertz
I think a much more sensible approach than mandating a limit because "who knows, it might speed something up" would be finding the speedup first. Probably that means one limit at a time too. E.g. maybe some patch imposes the 1 million LOC limit and demonstrates a repeatable benchmark improvement b

[Python-Dev] Re: More feedback on PEP 611, please

2019-12-11 Thread David Mertz
On Wed, Dec 11, 2019, 6:40 AM Mark Shannon wrote: > Another thing I would like feedback on this: > My justification for a single limit of one million across the board is to > ease memorization and learning. > Is that sufficient justification, or would differing limits be better? > Absolutely not

[Python-Dev] Re: More feedback on PEP 611, please

2019-12-11 Thread David Mertz
On Wed, Dec 11, 2019, 6:40 AM Mark Shannon wrote: > P.S. On the subject of tradeoffs, here's a bonus question: > What, in your opinion, increase in memory consumption is acceptable for a > 1% improvement in speed, or vice versa? I NEVER care about memory at all... except inasmuch as it effects

[Python-Dev] Re: Parameters of str(), bytes() and bytearray()

2019-12-15 Thread David Mertz
I bet someone in the world has written code like: foo = str(**dynamic-args()) And therefore, disabling "silly" combinations of arguments will break their code occasionally. On Sun, Dec 15, 2019, 9:09 AM Serhiy Storchaka wrote: > Currently str() takes up to 3 arguments. All are optional and > p

[Python-Dev] Re: Should set objects maintain insertion order too?

2019-12-16 Thread David Mertz
On Sun, Dec 15, 2019 at 11:28 PM Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > * The corresponding mathematical concept is unordered and it would be > weird to impose such as order. > I'm with Raymond in not wanting sets to maintain insertion (or any) order. Even though I don't doubt

[Python-Dev] Re: Parameters of str(), bytes() and bytearray()

2019-12-16 Thread David Mertz
On Mon, Dec 16, 2019 at 4:06 AM Serhiy Storchaka wrote: > 15.12.19 16:30, David Mertz пише: > > I bet someone in the world has written code like: > > > > foo = str(**dynamic_args()) > > > > And therefore, disabling "silly" combinations of arguments wil

[Python-Dev] Re: Should set objects maintain insertion order too?

2019-12-16 Thread David Mertz
On Mon, Dec 16, 2019, 7:35 PM David Cuthbert wrote: > On Mon 12/16/19, 9:59 AM, "David Mertz" wrote: > If some improved implementation of sets had the accidental side effects of > making them ordered, I would still not want that to become a semantic > guarantee. >

[Python-Dev] Re: Should set objects maintain insertion order too?

2019-12-19 Thread David Mertz
On Thu, Dec 19, 2019 at 5:39 PM Nick Coghlan wrote: > I took Larry's request a slightly different way: he has a use case where > he wants order preservation (so built in sets aren't good), but combined > with low cost duplicate identification and elimination and removal of > arbitrary elements (s

[Python-Dev] Re: Should set objects maintain insertion order too?

2019-12-23 Thread David Mertz
Even though I was the first person in this thread to suggest collections.OrderedSet, I'm "meh" about it now. As I read more and played with the sortedcollections package, it seemed to me that while I might want a set that iterated in a determinate and meaningful order moderately often, insertion or

[Python-Dev] Re: Merging PRs without CLA signed

2020-02-24 Thread David Mertz
There is, for better or worse, no bright line about what is copyrightable. Unfortunately, a lot of the standard is "how deep are the pockets of the opposing party?" If you are Oracle and you want to sue Google, code which any normal person world consider trivial becomes precious intellectual prope

[Python-Dev] Re: Accepting PEP 584: Add Union Operators To dict

2020-02-26 Thread David Mertz
I think the "if unset" behavior is well handled by collections.ChainMap. But I do think that fact should be prominent in any documentation of the new dict Union operator. On Wed, Feb 26, 2020, 11:06 AM Guido van Rossum wrote: > On Wed, Feb 26, 2020 at 7:43 AM Claudio Jolowicz > wrote: > >> In m

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-14 Thread David Mertz
I've written AttributeDict a fair number of times. Each time I write it from scratch, which is only a few lines. And I only make a silly wore about 50% of the time when I do so. I wonder if a separate type in collections might be a more natural way to get the desired effect. I do recognize that su

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-15 Thread David Mertz
A very long time ago, I wrote an XML library (Gnosis Utilities xml_objectify) that had this same issue, and adopted the "duality" approach (where possible, with both dictionary and other styles also available). JSON is sort of the new XML, and it feels like the same concern. FWIW, LXML explicitly

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-05-06 Thread David Mertz
Hi Guido, Pablo & Lysandros, I'm excited about this improvement to Python, and was interested to hear about it at the language summit as well. I happen to be friends with Alessandro Warth, whom you cited in the PEP as developing the packrat parsing technique you use (at least in part). I wrote t

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread David Mertz
I'm a little frustrated by the tone in which the PEP dismisses the option that is most supported in the discussion. It fine for Brandt to have a different preference himself, but I think it ought to be presented more neutrally. On Fri, May 15, 2020, 10:20 AM Steven D'Aprano > 1. +1 itertools.zip_

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread David Mertz
On Fri, May 15, 2020 at 12:55 PM Eric V. Smith wrote: > Also: The PEP says "At most one additional item may be consumed from one > of the iterators when compared to normal zip usage." I think this should > be prefaced with "If ValueError is raised ...". Also, why does it say "at > most one additi

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread David Mertz
Ok. That's true. It's technically correct as phrased. I glossed over the "compared to" aspect. I still think it could be made more clear. On Fri, May 15, 2020, 4:40 PM MRAB wrote: > On 2020-05-15 20:36, David Mertz wrote: > > On Fri, May 15, 2020 at 12:55

[Python-Dev] PEP 584 underspecified

2020-05-19 Thread David Mertz
I know this is late in the cycle to think of this. But I just realized the PEP 584 does not say anything about order guarantees. I think it is safe to assume that existing keys in dictA will not have order modified by `dictA |= dictB`. However, the PEP does not state what order we are given when

[Python-Dev] Re: PEP 584 underspecified

2020-05-19 Thread David Mertz
I comment on the PR. On Tue, May 19, 2020 at 4:44 PM Brandt Bucher wrote: > Maybe I'm missing something here. The PEP specifically says: > > > Similarly, the iteration order of the key-value pairs in the dictionary > will follow the same semantics as the examples above, with each newly added > k

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-06-02 Thread David Mertz
On Tue, Jun 2, 2020 at 8:07 AM Chris Angelico wrote: > > Given that the only input parameters are the iterables themselves, it's > a stretch to even consider the first two as possibilities. > > Why? I can conceivably imagine that zip(iter1, iter2, truncate=5) > would consume at most 5 elements fr

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-06-02 Thread David Mertz
On Tue, Jun 2, 2020, 9:41 AM Steve Dower > > As is, I use islice() or a break inside a loop, but that hypothetical > parameter might be a helpful > > convenience. > > Besides, "zip(iter1, iter2, range(5))" is the same length once you include > the extra unpack, plus it works well with earlier vers

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread David Mertz
def whereis(point): > match point: > case MovingPoint(0, 0): > print("Origin") > case MovingPoint(0, y): > print(f"Y={y}") > case MovingPoint(x, 0): > print(f"X={x}") > case MovingPoint(1, 1): > print("Diagonal at u

[Python-Dev] Re: PEP 622: Structural Pattern Matching -- followup

2020-06-24 Thread David Mertz
I gave a longer example, but the short version is that I cannot tell from the Class Pattern or Runtime section how class patterns interact with properties (i.e. when access changes state). On Wed, Jun 24, 2020, 3:45 PM Guido van Rossum wrote: > Everyone, > > If you've commented and you're worrie

[Python-Dev] Re: [Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-29 Thread David Mertz
The commit message is simply silly. It introduces numerous contentious and false claims that have nothing whatsoever to do with the small wording change. It misunderstands how language, culture, history, and indeed white supremacism, work. I would recommend amending the commit message. The underl

[Python-Dev] Re: [Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-29 Thread David Mertz
Can we simply revise the commit message to something neutral like "Removed specific reference to Strunk and White in favor of generic urge for language clarity." That's all the change actually was; there's no need for the other debate or broad political background. On Mon, Jun 29, 2020 at 3:28 PM

[Python-Dev] Re: [Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-30 Thread David Mertz
On Tue, Jun 30, 2020, 8:39 AM Steven D'Aprano wrote: > It needs to be pointed out that Thomas Wouters was recently re-elected to > the PSF board. I think we need to know whether Thomas speaks for the entire > PSF board. > That seems silly. Of course Thomas doesn't speak for the Board here, and n

[Python-Dev] Re: Recent PEP-8 change

2020-06-30 Thread David Mertz
On Tue, Jun 30, 2020, 10:38 AM Piper Thunstrom > The actual advice in The Elements of Style are mostly inoffensive when > taken on their own, and out of context. The problem is that the Elements of > Style (And many works like it) are built on a system of white supremacy. > The grammarian movement

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread David Mertz
Inado-san makes a very good point. The (English) language used in technical documents is not AAVE. It's not Scotts-English. It's not Jamaican vernacular. It's not Indian English. But it is ALSO not American upper-middle class, white ivy-league English. Technical documentation is a kind of DSL wit

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread David Mertz
On Thu, Jul 2, 2020, 11:08 AM Piper Thunstrom > Paul, this is actually a good question to ask. In general, singular "they" > is becoming more popular. It's already used frequently for the > singular indeterminate pronoun: > The first attested use of singular they in English was in 1375 CE. I'm no

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread David Mertz
On Thu, Jul 2, 2020 at 12:15 PM Paul Moore wrote: > My understanding is that technically "he" takes a dual role in > English, as both masculine (technical linguistics gender) 3rd person > singular and "indeterminate" 3rd person singular (because English > doesn't have an "indeterminate-but-not-ne

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread David Mertz
On Thu, Jul 2, 2020 at 12:58 PM Piper Thunstrom wrote: > > TL;DR: It's not a recent usage; it was OK in 1375. > > Forgive me for not giving a detailed play by play of 15 years of > experience specifically as a writer and editor. > Over the last handful of decades, singular "they" has been explici

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-02 Thread David Mertz
On Thu, Jul 2, 2020 at 1:36 PM David Antonini wrote: > Surely, if the argument is to be as inclusive and easy as possible, > British English should be used? Things may have changed, but my impression > is that the majority of English-second-language (ESL) speakers learn > British English, not Ame

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-02 Thread David Mertz
On Thu, Jul 2, 2020 at 8:34 PM Łukasz Langa wrote: > Commit messages aren't usually scrutinized to this extent. If you looked > at the last 1000 commits in cpython, you'd find quite a few with messages > that could be seriously improved. We don't though because commits are > immutable. You can re

[Python-Dev] Re: [OT] Speaking of the recent PEP-8 change

2020-07-05 Thread David Mertz
On Sun, Jul 5, 2020 at 2:37 PM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > > Are you saying that people who split infinitives are usually > > black, > > Of course not. Base rates suggest they're mostly white. > I think that's not true. According to this, English speake

[Python-Dev] Re: Python is the only language with lack of const'ness in core, also affects: Re: PEP 622: Structural Pattern Matching

2020-07-08 Thread David Mertz
On Wed, Jul 8, 2020, 12:22 PM Paul Sokolovsky > popular VHLL/scripting languages which doesn't support defining of > constants in the core language: > > JavaScript has "const foo = 1;" > PHP has "const foo = 1;" > Perl has "use constant foo => 1;" > Lua has "local foo = 1" > - > > > - Mathema

[Python-Dev] Re: Python is the only language with lack of const'ness in core, also affects: Re: PEP 622: Structural Pattern Matching

2020-07-08 Thread David Mertz
On Wed, Jul 8, 2020, 1:00 PM Paul Sokolovsky > Right. So, if someone would like to add something to this thread, I'd > humbly suggest to concentrate on the lack of, and need for, of > const-ness in the Python language core (in comparison to other languages > or not), and usecases it enables, and n

[Python-Dev] Re: Python is the only language with lack of const'ness in core, also affects: Re: PEP 622: Structural Pattern Matching

2020-07-08 Thread David Mertz
On Wed, Jul 8, 2020, 1:50 PM Paul Sokolovsky > > I admit I do not really understand what gain dynamic languages get from > constants. I pretty uniformly use a common convention of ALLCAPS for > constant names > > > I can easily imagine that a VM might gain speed with that information, > but that a

[Python-Dev] Re: Function suggestion: itertools.one()

2020-07-27 Thread David Mertz
I don't like consuming the iterator in the exception case. You might expect just one, but have a fallback approach for more. You could build the safer behavior using itertools.tee() or itertools.chain(). On Mon, Jul 27, 2020, 3:10 PM Noam Yorav-Raphael wrote: > Hi, > > There's a simple function

[Python-Dev] Re: Hygenic macros PEP.

2020-09-15 Thread David Mertz
Three-ish questions: 1. What could this do that Macropy does not already do? (yes, I know "run as top-level script", but that's uninspiring for me). 2. Do you have any evidence Numba developers would actually want this?! (as claimed in draft FAQ). I know a lot of them, and teach Numba sometimes,

[Python-Dev] Re: Farewell, Python 3.5

2020-10-01 Thread David Mertz
Thank you so much Larry, for your wonderful work. On Thu, Oct 1, 2020 at 8:44 AM Eric V. Smith wrote: > Thanks for all of your work, Larry. I really think it was the stability of > these releases that helped push 3.x into dominance over 2.7. > > 3 version control systems. Insane! > > Eric > On

[Python-Dev] Re: [python-committers] Resignation from Stefan Krah

2020-10-09 Thread David Mertz
On Fri, Oct 9, 2020 at 10:25 AM Charalampos Stratakis wrote: > Does it really matter that much in regards to the specific context? If > someone poses problematic behavior (as it seems, as I'm not familiar with > any specifics here), maintenance of a module should be the last of the > worries. The

[Python-Dev] Re: Changing Python's string search algorithms

2020-10-13 Thread David Mertz
I'm sure that the large majority of the string searches I've done are in Larry's tiny category. However, I also think that big data needs are increasing, and things like FASTA files can be enormously large texts that one has good reasons to search on. If there is a heuristic switch between algori

[Python-Dev] Re: Changing Python's string search algorithms

2020-10-14 Thread David Mertz
On Wed, Oct 14, 2020 at 7:45 PM Steven D'Aprano wrote: > Perhaps this is a silly suggestion, but could we offer this as an > external function in the stdlib rather than a string method? > That feels unworkable to me. For one thing, the 'in' operator hits this same issue, doesn't it? But for ano

[Python-Dev] Re: Problems with dict subclassing performance

2021-08-15 Thread David Mertz, Ph.D.
I also haven't the faintest idea what might be intended by the phrase "I pretend your immediate excuses". But whatever the intention, it is clear Marco has veered off into angry ranting territory. Him taking a couple weeks away from this list would be an extremely good idea. On Sun, Aug 15, 2021,

[Python-Dev] Re: [Python-ideas] Re: open functions in dbm submodule need to support path-like object

2021-09-07 Thread David Mertz, Ph.D.
I attempted to do this today, as my first actual contribution to CPython itself. I think the prior attempt went down a wrong path, which is why neither PR could actually pass tests. I've been looking at `posixmodule.c` for comparison, specifically. The key thing, I believe, is not to use `PyObje

[Python-Dev] Re: [Python-ideas] Re: open functions in dbm submodule need to support path-like object

2021-09-08 Thread David Mertz, Ph.D.
is already occurring when passed a PosixPath. On Wed, Sep 8, 2021 at 3:49 AM Serhiy Storchaka wrote: > 08.09.21 08:19, David Mertz, Ph.D. пише: > > I attempted to do this today, as my first actual contribution to CPython > > itself. I think the prior attempt went down a wrong

[Python-Dev] Re: f-strings in the grammar

2021-09-20 Thread David Mertz, Ph.D.
I know I'm strongly -1 on allowing much more than currently exists for f-strings. For basically the same reason Stephen explains. Newlines inside braces, for example, go way too far away from readability. Nested expressions also feel like an attractive nuisance. I use f-strings all the time, but i

[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2021-10-18 Thread David Mertz, Ph.D.
On Mon, Oct 18, 2021 at 6:49 PM Paul Moore wrote: > On Mon, 18 Oct 2021 at 19:29, Guido van Rossum wrote: > > y = None # Default > > if config is not None: > > handler = config.get("handler") > > if handler is not None: > > parameters = handler.get("parameters") > > if parameters is

[Python-Dev] Semi-proposal: Tagged None

2021-10-21 Thread David Mertz, Ph.D.
On Thu, Oct 21, 2021 at 2:52 AM Steven D'Aprano wrote: > On Tue, Oct 19, 2021 at 05:09:42PM -0700, Michael Selik wrote: > > None and its ilk often conflate too many qualities. For example, is it > > missing because it doesn't exist, it never existed, or because we never > > received a value, desp

[Python-Dev] Re: Semi-proposal: Tagged None

2021-10-21 Thread David Mertz, Ph.D.
I've moved this to python-ideas where it is more appropriate, as Chris notes On Thu, Oct 21, 2021, 8:42 PM Chris Angelico wrote: > On Fri, Oct 22, 2021 at 3:23 AM David Mertz, Ph.D. > wrote: > > > > On Thu, Oct 21, 2021 at 2:52 AM Steven D'Aprano > wrote: >

[Python-Dev] Re: pre-PEP: Unicode Security Considerations for Python

2021-11-02 Thread David Mertz, Ph.D.
This is an amazing document, Petr. Really great work! I think I agree with Marc-André that putting it in the actual Python documentation would give it more visibility than in a PEP. On Tue, Nov 2, 2021, 1:06 PM Marc-Andre Lemburg wrote: > On 01.11.2021 13:17, Petr Viktorin wrote: > >> PEP:

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-10 Thread David Mertz, Ph.D.
I agree with Tim. Subject, of course, to the same caveat Tim mentions: does the creator want this? I haven't used the library much, but it's obviously top quality, and adding pure-Python code is less burden than C implementations. On Wed, Nov 10, 2021, 10:19 PM Tim Peters wrote: > [Bob Fang ] >

[Python-Dev] Re: Preventing Unicode-related gotchas (Was: pre-PEP: Unicode Security Considerations for Python)

2021-11-14 Thread David Mertz, Ph.D.
On Sun, Nov 14, 2021, 2:14 PM Christopher Barker > It's probably to deal with "é" vs "é", i.e. "\N{LATIN SMALL LETTER >> E}\N{COMBINING ACUTE ACCENT}" vs "\N{LATIN SMALL LETTER E WITH ACUTE}", >> which are different ways of writing the same thing. >> > > Why does someone that wants to use, .e.g.

[Python-Dev] Re: The current state of typing PEPs

2021-11-29 Thread David Mertz, Ph.D.
On Mon, Nov 29, 2021 at 8:17 PM Guido van Rossum wrote: > Why would it need to be reiterated? Are there really people who believe > that such code would become invalid? AFAIK *everybody* here agrees that > this should stay valid. So who would we be reiterating it for? > I'm certainly not alone,

[Python-Dev] Re: Python release announcement format

2021-12-19 Thread David Mertz, Ph.D.
On Sun, Dec 19, 2021, 11:49 AM Steven D'Aprano > And both the download and the webpage listing the checksum are over https. > If we don't trust https, the whole internet is broken and changing to a > stronger checksum won't help. A hypothetical MITM attacker capable of > breaking https and injecti

[Python-Dev] Re: Python 3.10 vs 3.8 performance degradation

2021-12-19 Thread David Mertz, Ph.D.
My guess is that this difference is predominantly different builds of NumPy. For example, the Intel optimized builds are very good, and a speed difference of the magnitude shown in this note are typical. E.g. https://www.intel.com/content/www/us/en/developer/articles/technical/numpyscipy-with-int

[Python-Dev] Re: Python 3.10 vs 3.8 performance degradation

2021-12-19 Thread David Mertz, Ph.D.
Not the version, but the build. Did you compile NumPy from source using the same compiler with both Python versions? If not, that remains my strong hunch about performance difference. Given what your programs do, it sure seems like the large majority of runtime is spent in supporting numeric libra

[Python-Dev] Re: Python 3.10 vs 3.8 performance degradation

2021-12-19 Thread David Mertz, Ph.D.
These are binary wheel installs though, no? Which means 3.8 version and 3.10 version were compiled at different times, even for the same NumPy version. Also for different platforms, I don't know which you are on. I haven't checked what's on PyPI for each version. I think PyFFT is largely using Num

[Python-Dev] Re: New PEP website is horrible to read on mobile device

2022-03-15 Thread David Mertz, Ph.D.
I get pretty much the same thing as the OP on Chrome 99.0.4844.58; Android 11; Pixel 2 XL; Build RP1A.201005.004.A1. However, it gets more readable if I force Desktop site and zoom a bit. These facts are pretty common for a lot of websites, and I never gave it much thought. But yes, the mobile ve

[Python-Dev] Re: About PEPs being discussed on Discourse

2022-04-07 Thread David Mertz, Ph.D.
FWIW, I find Discourse (and everything similar that I've seen), awkward, difficult to use, poorly organized, and in every way inferior to my mail client. Obviously, other people differ in opinion. Quite likely the majority of cpython developers disagree. I don't think I'm entirely alone in this ex

[Python-Dev] Re: Switching to Discourse

2022-07-21 Thread David Mertz, Ph.D.
I feel similarly as Steven. I'm even less important to the development of CPython than he is. But like him, switching to Discourse means I simply won't try to follow development. Mailing list are friendly and easily manageable. In the small amount I've used Discourse, it feels unwieldy and less fr

[Python-Dev] Re: PEP 638: Syntactic macros

2023-02-02 Thread David Mertz, Ph.D.
On Thu, Feb 2, 2023 at 12:46 PM Stéfane Fermigier wrote: > https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode > https://oeis.org/wiki/List_of_LaTeX_mathematical_symbols > NB: on a very basic level, I remember trying, a few years ago, to use the > Unicode "empty set" symbo

<    1   2