I think the core issue is that, whether or not it should be used, APIs already return None values, so a convenience operator might as well be added.

On September 19, 2015 2:09:48 PM CDT, "Sven R. Kunze" <srkunze@mail.de> wrote:
On 19.09.2015 14:48, Stephen J. Turnbull wrote:
Sven R. Kunze writes:

Issue is, None is so convenient to work with. You only find out the
code smell when you discover a "NoneType object does not have
attribute X"

That's exactly what should happen (analogous to a "signalling NaN").

Not my point, Stephen. My point is, you better avoid None (despite its
convenience) because you are going to have a hard time finding its
origin later in the control flow.

Question still stands: is None really necessary to justify the
introduction of convenience operators like "?." etc.?

The problem is if you are using None as a proxy for a NULL in another
subsystem that has "NULL contagion" (I prefer that to "coalescing").

How would you solve instead?


Best,
Sven


Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

--
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.