none looks similar to None.<div><br></div><div>The code below rightly gives a NameError. If none were a builtin function, not only would it allow the bug below but it would evaluate to True.</div><div><br></div><div><div>>>> def f(x=none):</div>
<div>...     if x:</div><div>...         do_stuff()</div><div>...</div><div>Traceback (most recent call last):</div><div>  File "<stdin>", line 1, in <module></div><div>NameError: name 'none' is not defined</div>
</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Tue, Apr 10, 2012 at 4:22 PM, Steven Samuel Cole <span dir="ltr"><<a href="mailto:steven.samuel.cole@gmail.com">steven.samuel.cole@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hello,<br>
<br>
i'm aware they've been around for quite a while, but for some reason, i did not have the builtins all(seq) and any(seq) on the radar thus far. when i used them today, i just assumed there was a corresponding none(seq), but was surprised to learn that is not true.<br>

<br>
why is that ? has this been considered ? discussed ? dismissed ? i did search, but the net being neither case-sensitive nor semantic, the results were off topic.<br>
<br>
sure, i can do not all or not any or any of these:<br>
<a href="http://stackoverflow.com/q/6518394/217844" target="_blank">http://stackoverflow.com/q/<u></u>6518394/217844</a><br>
<a href="http://stackoverflow.com/q/3583860/217844" target="_blank">http://stackoverflow.com/q/<u></u>3583860/217844</a><br>
but none(seq): True if all items in seq are None<br>
would IMHO be the pythonic way to do this.<br>
<br>
what do you think ?<br>
<br>
# ssc<br>
______________________________<u></u>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-ideas</a><br>
</blockquote></div><br></div>