<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Oct 29, 2016 at 3:53 AM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><span style="color:rgb(34,34,34)">Hmmm. I see your point, but honestly, None *is* special. Even for</span><br></div></div>
special objects, None is even more special.</blockquote><div><br></div><div>As a contributor to and user of many numerical computing libraries in Python (e.g., NumPy, pandas, Dask, TensorFlow) I also agree here.</div><div><br></div><div>Implicit non-existence for NotImplemented and Ellipsis seem particularly problematic, because these types are rarely used, and the meaning of these types intentionally differs from other missing types:</div><div>- In NumPy, None is a valid indexing argument, used as a sentinel marker for "insert a new axis here". Thus x[..., None] means "insert a new axis at the end."</div><div>- Likewise, implicit checks for NotImplemented would be problematic in arithmetic, because NaN is also a perfectly valid result value for arithmetic. Especially in this case, checking for "missingness" could look attractive at first glance to implementors of special methods for arithmetic but could later lead to subtle bugs.</div><div><br></div><div>I'm have more mixed fillings on testing for NaNs. NaNs propagate, so explicit testing is rarely needed. Also, in numerical computing we usually work with arrays of NaN, so operator.exists() and all this nice syntax would not be a substitute for numpy.isnan or pandas.isnull.</div><div><br></div><div>On the whole, I do think that adding systematic checks for None to Python with dedicate syntax would be a win. If making NaN "missing" and allowing user defined types to be "missing" would help make that happen, then sure, go ahead, but I see few use cases. </div><div><br></div></div></div></div>