[Python-ideas] Null coalescing operator
Stephen J. Turnbull
turnbull.stephen.fw at u.tsukuba.ac.jp
Fri Oct 28 22:02:36 EDT 2016
Mark E. Haase writes:
> In terms of "bunch of longer examples", what did you have in mind?
> I could take some popular library and rewrite a section of it with
> the proposed operators, but that would depend on the response to
> the previous paragraph.
I gather you think you have a deadlock here. The way to break it is
to just do it. Pick a syntax and do the rewriting. My memory of some
past instances is that many of the senior devs (especially Guido) will
"see through the syntax" to evaluate the benefits of the proposal,
even if they've said they don't particularly like the initially-
proposed syntax. Unfortunately here the most plausible syntax is one
that Guido has said he definitely doesn't like: using '?'. The
alternatives are pretty horrible (a Haskell-like 'maybe' keyword, or
the OPEN SQUARE character used by some logicians in modal logic -- the
problem with the latter is that for many people it may not display at
all with their font configurations, or it may turn into mojibake in
email.
OTOH, that case was an astral character -- after Guido announced his
opposition to '?', the poster used PILE OF POO as the operator. OPEN
SQUARE is in the basic multilingual plane, so probably is OK if the
recipient can handle Unicode. '?' vs. '□': maybe that helps narrow
the choice set?
More information about the Python-ideas
mailing list