Issue 34644: Bug in reverse method (original) (raw)

This is not a bug or a syntax error, and the behaviour goes back to at least Python 1.5 if not older.

List.reverse returns a reference to the method object itself. List.reverse() calls the method. This is standard behaviour in Python, all methods and functions are first-class values, anything you can do with an object, you can do with a function or method too. For example:

py> list.reverse.name 'reverse' py> print(len) py> alist = [1, "a", chr] py> print(alist) [1, 'a', ]