Question: If I use any of the CRUD methods of SocialDataService (eg: AddComment), I find that even once the POST has returned successfully SharePoint has not actually processed the change. By that I mean that a quick call to GetCommentsOnUrl will return the old data, even though I am clearly making my request only after receiving a reply.

**Is there a specific delay time I can wait to be sure SP has had time to process the change?** If I'm using AJAX to perform changes to a page (which could in the meantime have also been changed by other users) I'd like to present the most up-to-date version, so how long do I wait before re-polling the web service?

edit: longer than 1 second, less than 1.5 is this a server setting or something?

Answer: 
```
lista = list.sort(lista)

```

This should be

```
lista.sort()

```

The `.sort()` method is in-place, and returns None. If you want something not in-place, which returns a value, you could use

```
sorted_list = sorted(lista)

```

Aside #1: please don't call your lists `list`. That clobbers the builtin list type.

Aside #2: I'm not sure what this line is meant to do:

```
print str("value 1a")+str(" + ")+str("value 2")+str(" = ")+str("value 3a ")+str("value 4")+str("\n")

```

is it simply

```
print "value 1a + value 2 = value 3a value 4"

```

? In other words, I don't know why you're calling str on things which are already str.

Aside #3: sometimes you use `print("something")` (Python 3 syntax) and sometimes you use `print "something"` (Python 2). The latter would give you a SyntaxError in py3, so you must be running 2.\*, in which case you probably don't want to get in the habit or you'll wind up printing tuples, with extra parentheses. I admit that it'll work well enough here, because if there's only one element in the parentheses it's not interpreted as a tuple, but it looks strange to the pythonic eye..
As previously said in one of the answers this error occurs when value of the list turns out to be empty. Well though not fully relevant to this question, the same error occured for me while reading images using opencv and numpy because the file name was found to be different than that specified probably or because the working directory has not been specified properly.