[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"

[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

[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

[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

[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

[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

[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.

[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

[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: 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: 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: 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: 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] 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,

[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

[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

[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.
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 path, which is why > > neither PR could act

[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

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

2021-08-16 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,

[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

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

2021-05-20 Thread David Mertz
re 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, of course, we might get identity by internin

[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
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.

[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 inspectable in

[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-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

[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()

[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

[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: >>

[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,

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

2021-04-14 Thread David Mertz
On Wed, Apr 14, 2021 at 9:12 PM Paul Moore wrote: > If it's not basically equivalent to packaging.version.Version (and > based on PEP 440) then we'll be creating a nightmare of confusion, > because PEP 440 versions are fundamental to packaging. > Are you suggesting that users should have to

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

2021-04-14 Thread David Mertz
On Wed, Apr 14, 2021 at 5:44 PM Christopher Barker wrote: > Another possible issue: using Version would require an extra import in > many module initializations -- is that a performance issue that would > matter? > I like having a `Version` object that is easily importable in the standard

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

2021-04-14 Thread David Mertz
wrote: > On Wed, Apr 14, 2021 at 7:48 AM David Mertz wrote: > >> >>> vaex.__version__ >> {'vaex': '4.1.0', 'vaex-core': '4.1.0', 'vaex-viz': '0.5.0', 'vaex-hdf5': >> '0.7.0', 'vaex-server': '0.4.0', 'vaex-astro': '0.8.0', 'vaex-jupyter': >> '0.6.0', 'vaex-ml':

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

2021-04-14 Thread David Mertz
I recently encountered this, which is very useful, but only for a human-readable perspective. >>> import vaex >>> vaex.__version__ {'vaex': '4.1.0', 'vaex-core': '4.1.0', 'vaex-viz': '0.5.0', 'vaex-hdf5': '0.7.0', 'vaex-server': '0.4.0', 'vaex-astro': '0.8.0', 'vaex-jupyter': '0.6.0', 'vaex-ml':

[Python-Dev] Re: Boundaries between numbers and identifiers

2021-04-13 Thread David Mertz
I feel like all of these examples, if found in the wild, are far more likely to be uncaught bugs than programmer intent. Being strict about spaces (or parents, brackets, etc. in other contexts) around numbers is much more straightforward than a number of edge cases where is not obvious what will

[Python-Dev] Re: Steering Council update for February

2021-03-10 Thread David Mertz
On Wed, Mar 10, 2021, 4:30 PM Steven D'Aprano wrote: > > All the other examples are also forced and contrived. This is perhaps > worst. I own several chains for purposes having nothing to do with bondage > or oppression. > > Chains are an almost universal symbol of bondage and slavery: "Man is

[Python-Dev] Re: Steering Council update for February

2021-03-10 Thread David Mertz
On Wed, Mar 10, 2021 at 1:13 PM Evpok Padding wrote: > Apparently renaming a git branch to follow the general convention is now > an unbearable outrage. It strikes me as a somewhat odd hill to die on, but > okay. However there is a code of conduct that is supposed to be followed > here

[Python-Dev] Re: Python 0.9.1

2021-02-19 Thread David Mertz
In conversation with Dan, I have fixed my conda package (but overwritten the same version). I needed to add this to the build: # sudo apt-get install gcc-multilib CC='gcc -m32' make python I don't have 32-bit headers by default anymore on my distro. With that change, I can run: % conda

[Python-Dev] Re: Python 0.9.1

2021-02-18 Thread David Mertz
I've provided this excellent language interpreter as a conda package. For users of conda, you can install it (on Linux) with: conda install -c davidmertz python=0.9 (perhaps put it in a different environment than base). I'm embarrassed by how much effort that took me. I used to teach

[Python-Dev] Re: Python 0.9.1

2021-02-18 Thread David Mertz
Will someone publish an manylinux build to conda-forge (or their own channel)? On Thu, Feb 18, 2021 at 9:15 PM Dan Stromberg wrote: > > On Thu, Feb 18, 2021 at 12:02 AM Paul Sokolovsky > wrote: > >> I think to resolve this issue to the completion, and avoid possibility >> of an intermediary to

[Python-Dev] Re: PEP 647 (type guards) -- final call for comments

2021-02-14 Thread David Mertz
On Sun, Feb 14, 2021, 5:34 PM Guido van Rossum wrote: > But note that 'bool' in Python is not subclassable. > Sure. But that's why I suggested 'Bool' rather than 'bool'. It's a different spelling, but one with a really obvious connection. > > I.e. if I read this: >> >> def is_str_list(v:

[Python-Dev] Re: PEP 647 (type guards) -- final call for comments

2021-02-14 Thread David Mertz
On Sun, Feb 14, 2021, 2:53 PM Gregory P. Smith wrote: > *TL;DR of my TL;DR* - Not conveying bool-ness directly in the return > annotation is my only complaint. A BoolTypeGuard spelling would > alleviate that. > This is exactly my feeling as well. In fact, I do not understand why it cannot

[Python-Dev] Re: unittest of sequence equality

2020-12-22 Thread David Mertz
On Tue, Dec 22, 2020 at 11:44 PM Alan G. Isaac wrote: > My question is not about work arounds. > It is about whether the current definition of a sequence > (in collections.abc) should govern `assertSequenceEqual`. > Why do you think a NumPy array is a sequence? E.g.: >>> a array([[1, 2],

[Python-Dev] Re: unittest of sequence equality

2020-12-22 Thread David Mertz
On Tue, Dec 22, 2020 at 6:57 PM Alan G. Isaac wrote: > The following test fails because because `seq1 == seq2` returns a > (boolean) NumPy array > whenever either seq is a NumPy array. > > import unittest > import numpy as np > unittest.TestCase().assertSequenceEqual([1.,2.,3.], >

[Python-Dev] Re: SC 2020 recommendation for PEP 634

2020-12-08 Thread David Mertz
As a candidate for the new SC, if elected I would certainly find it more useful to have more specific thoughts from the outgoing SC than simply "we recommend." How divided was the vote? Who took the sides? What were the major points of disagreement? That sort of thing. On Tue, Dec 8, 2020 at 9:39

[Python-Dev] Re: nanosecond stat fields, but not os.path methods ?

2020-12-07 Thread David Mertz
Are there any filesystems that can actually record a meaningful ns modification time? I find discussions claiming this: - XFS and EXT3: second precision - EXT4: millisecond precision - NTFS: 100ns precision - APFS: 1 ns precision But also notes that the precision is likely to exceed the

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread David Mertz
> > I'd put the question this way: assuming Matcher can be written (with a bit > of stack magic), and assuming that the strings inside m.case() calls are > exactly the same mini-languague PEP 634 proposes, would you want a syntax > change? > > No, I wouldn't! > Is one of us mixing up negations?

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread David Mertz
On Mon, Nov 23, 2020, 4:32 PM Eric V. Smith > I just commented on Steve's post over on Discourse. The problem with this > is that the called function (m.case, here) needs to have access to the > caller's namespace in order to resolve the expressions, such as StringNode > and PairNone. This is one

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread David Mertz
On Mon, Nov 23, 2020 at 9:02 PM Brian Coleman wrote: > > Basically, I agree matching/destructuring is a powerful idea. But I also > > wonder how much genuinely better it is than a library that does not > require > > a language change. For example, I could create a library to allow this: > >

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread David Mertz
I have a little bit of skepticism about the pattern matching syntax, for similar reasons to those Larry expresses, and that Steve Dower mentioned on Discourse. Basically, I agree matching/destructuring is a powerful idea. But I also wonder how much genuinely better it is than a library that does

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread David Mertz
On Mon, Nov 23, 2020, 2:58 PM Ethan Furman > >> if isinstance(node, StringNode): > >> return node.value > >> elif isinstance(node, NumberNode): > >> return float(node.value) > >> elif isinstance(node, ListNode): > >> return

[Python-Dev] Re: Words rather than sigils in Structural Pattern Matching

2020-11-21 Thread David Mertz
On Sat, Nov 21, 2020 at 2:47 PM Guido van Rossum wrote: > On Sat, Nov 21, 2020 at 9:52 AM David Mertz wrote: > >> So in my mind, if I had the choice, it is a decision between a sigil and >> a word to indicate "no, really use this name as a value!" I lik

[Python-Dev] Re: Words rather than sigils in Structural Pattern Matching

2020-11-21 Thread David Mertz
" I like a word better, but none of the current keywords really make sense, so it would need to be a new word. I suggested "value", but another word might be better. On Thu, Nov 12, 2020 at 7:38 PM David Mertz wrote: > One idea that I cannot recall seeing, but that se

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-21 Thread David Mertz
On Sat, Nov 21, 2020 at 12:23 PM Steven D'Aprano wrote: > Clearly Spam(a=1, b=2) does not necessarily result in an instance with > attributes a and b. But the pattern `Spam(a=1, b=2)` is intended to be > equivalent to (roughly): > > if (instance(obj, Spam) > and getattr(obj, a) == 1

[Python-Dev] Re: Pattern Matching controversy: Don't read PEP 635, read DLS'20 paper instead

2020-11-15 Thread David Mertz
Complimentary != Complementary On Sun, Nov 15, 2020, 4:51 AM Paul Sokolovsky wrote: > Hello, > > As was mentioned many times on the list, PEP634-PEP636 are thoroughly > prepared and good materials, many thanks to their authors. PEP635 > "Motivation and Rationale"

[Python-Dev] Words rather than sigils in Structural Pattern Matching

2020-11-12 Thread David Mertz
I have read a great deal of discussion on the pattern matching PEPs and less formal discussions. It is possible I have overlooked some post in all of that, of course. ... OK, just saw Guido's "wait for new SC" comment, which I suppose applies to this too :-). One idea that I cannot recall

[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

[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

[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.

[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: 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

[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: 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

[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

[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" > - > > > -

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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 >

[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

[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 PM Eric V.

[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

[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

[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

[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: 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

[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

[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

[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

[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

[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: 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 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-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 >

[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: 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

[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

[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

  1   2   >