A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20140217/a608348c/attachment.html below:

<p dir="ltr"><br>
On 17 Feb 2014 21:15, "M.-A. Lemburg" <<a href="mailto:mal@egenix.com">mal@egenix.com</a>> wrote:<br>
><br>
> On 15.02.2014 07:03, Stephen J. Turnbull wrote:<br>
> > M.-A. Lemburg writes:<br>
> ><br>
> >  > IMO, it was a mistake to have None return a TypeError in<br>
> >  > comparisons, since it makes many typical data operations<br>
> >  > fail, e.g.<br>
> ><br>
> > I don't understand this statement.  The theory is that they *should*<br>
> > fail.<br>
> ><br>
> > The example of sort is a good one.  Sometimes you want missing values<br>
> > to be collected at the beginning of a list, sometimes at the end.<br>
> > Sometimes you want them treated as top elements, sometimes as bottom.<br>
> > And sometimes it is a real error for missing values to be present.<br>
> > Not to mention that sometimes the programmer simply hasn't thought<br>
> > about the appropriate policy.  I don't think Python should silently<br>
> > impose a policy in that case, especially given that the programmer may<br>
> > have experience with any of the above treatments in other contexts.<br>
><br>
> None is special in Python and has always (and intentionally) sorted<br>
> before any other object. In data processing and elsewhere in Python<br>
> programming, it's used to signal: no value available.</p>
<p dir="ltr">This is the first I've ever heard of that sorting behaviour being an intentional feature, rather than just an artefact of Python 2 allowing arbitrarily ordered comparisons between different types. Can you point me to the relevant entry in the Python 2 language reference? </p>

<p dir="ltr">Cheers,<br>


Nick.<br>
</p>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4