
Christopher Barker wrote:
if | is implemented, I'll bet you dollars to donuts that it will get used far less than if + were used. (though some on this thread would think that's a good thing :-) ) -CHB
(Non-beginner, |-preferrer) I think Christopher is correct here, but only to a point. I think he's right that the *initial* adoption of the syntax would be slower for |/|= as compared to +/+=. Thinking about what I understand as the four major "wings" of Python's application space (yah, I'm probably oversimplifying, don't @ me), though, I figure uptake of the syntax in two of the three wings either (a) will be slow *anyways* or (b) *ought* to be slow, to avoid messing people up. Libraries: If a final PEP is accepted, the syntax will become available in 3.9 or 3.10 or whatever.... but, most libraries won't use the syntax until they drop support for the Python versions without it. So, uptake will inevitably be ~glacial here. Lots of opportunities for people to start seeing the syntax, do a double-take, and if interested hop over to the docs and learn. Really, the obscurity of | would actually encourage docs-checking, I would think. Tools (CLI etc.): Basically the same as for libraries, except probably even slower -- tools have to be *very* conservative in their assumptions about the version of Python that will be available in an arbitrary installation environment. Data Science: In this space, I feel like the more-obscure nature of | is of particular benefit. My understanding is that many people doing work here overall tend to have less training in the art of programming itself (whether schooling, direct coding expertise, or whatever), and thus might be more likely to naively use '+' and get themselves into trouble. I feel like the unfamiliarity of | will make them be less instinctively confident that they know what the operation will do, and more likely to look carefully at it as they start trying to use it. Web: This is the space where I think Christopher's concerns about the downside of slow uptake will be most relevant, as to my understanding most web devs probably have enough experience with dicts to know that "d1 + d2" is not a trivial operation, and they have to make sure they know what it's actually doing under the hood. Slower uptake with | would thus be a downside... but it's not like this is a major optimization or anything. So: In most cases, uptake will be slow anyways. I'd rather have it be a bit slower, and use an operator that will make people think more carefully about what it does while they're learning to use it. (As I said before, I also agree with the semantic arguments for | over +.)