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/20051228/be413cce/attachment.htm below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [Python-Dev] Keep default comparisons - or add a second set?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Noam Raphael wrote:<BR>


&gt; I don't think that every type that supports equality<BR>
&gt; comparison should support order comparison. I think<BR>
&gt; that if there's no meaningful comparison (whether<BR>
&gt; equality or order), an exception should be raised.<BR>
<BR>
Just to keep myself sane...<BR>
<BR>
&nbsp;&nbsp;&nbsp; def date_range(start=None, end=None):<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if start == None:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start = datetime.date.today()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if end == None:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end = datetime.date.today()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return end - start<BR>
<BR>
Are you saying the &quot;if&quot; statements will raise TypeError if start or end are dates? That would be a sad day for Python. Perhaps you're saying that there is a &quot;meaningful comparison&quot; between None and anything else, but please clarify if so.<BR>
<BR>
<BR>
Robert Brewer<BR>
System Architect<BR>
Amor Ministries<BR>
fumanchu@amor.org</FONT>
</P>

</BODY>


</HTML>

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