using the sort method with python

I would like to use the sort method of a range from a python script.
This works well from oobasic but with python the sort command seems to be ignored. No error is thrown.
Here is the sample code I am using:
doc = XSCRIPTCONTEXT.getDocument()

oSheet = doc.CurrentController.ActiveSheet

selection = doc.CurrentSelection

sortfield = uno.createUnoStruct(“com.sun.star.table.TableSortField”)

sortfield.Field = 0

sortfield.IsAscending = True

sortfield.IsCaseSensitive = False

odesc = selection.createSortDescriptor()

odesc[3].Value = sortfield

selection.sort(odesc)

The SortFields property requires an array, not a single field. Create this in Python by sending a tuple to uno.Any().

import uno

for prop in odesc:
    if prop.Name == 'SortFields':
        prop.Value = uno.Any(
            '[]com.sun.star.table.TableSortField', (sortfield,))