Sorting a List of Lists



I can't seem to get this nailed down and I thought I'd toss it out
there as, by gosh, its got to be something simple I'm missing.

I have two different database tables of events that use different
schemas. I am using python to collate these records for display. I do
this by creating a list of lists that look roughly like this:

events = [['Event URL as String', 'Event Title as String ', Event Date
as Datetime], ...]

I then thought I'd just go events.sort(lambda x,y: x[2]<y[2]) and call
it a day. That didn't work. But then lamda functions like to be very
simple, maybe object subscripts aren't allowed (even though I didn't
get an error). So I wrote a comparison function that looks much as you
would expect:

def date_compare(list1,
list2):
x = list1[2]
y = list2[2]
if
x>y:
return
1
elif
x==y:
return
0
else: #
x<y
return -1

But as before sorting with this function returns None.

What have I overlooked?

.



Relevant Pages

  • Re: Member server not in network nhood.
    ... the shares on the server? ... > System Missing from its Local Subnet Master Browser's List ... > also be missing from all other browse lists. ...
    (microsoft.public.windows.server.networking)
  • Re: Member server not in network nhood.
    ... Is there anyway to capture the annoucning broadcast when the server boots. ... >> System Missing from its Local Subnet Master Browser's List ... >> also be missing from all other browse lists. ...
    (microsoft.public.windows.server.networking)
  • Re: compile+link Fujitsu Linux
    ... Populating them is controlled by component lists, ... New files can be missing from the list. ... Startup doesn't just check for the library's existance, ... The scope of the globe may be smaller than other ...
    (comp.lang.cobol)
  • Re: Cantors wrong! (doubt it)
    ... But this is simply not true for all starting lists N. For example, ... so your method has failed to produce a value x missing from the ... but simply on how the sequence produces the missing ... > computer to perform an infinite number of calculations in finite time. ...
    (comp.theory)
  • Re: My Network Places browsing
    ... You need to start with the missing machine and attempt to map ... > The domain master browser does not have the missing system in its browse ... > lists on other subnet master browsers. ...
    (microsoft.public.windows.server.networking)