[issue1691] feature request: methods that modify instances should return instance

2007-12-23 Thread Peter Farson
New submission from Peter Farson: Here's an example: I'd like to be able to reverse a list for iterating... for i in range(10).reverse() This could work if reverse method returned self, but currently it doesn't return anything. I think the overhead is slight and worth it. --

[issue1691] feature request: methods that modify instances should return instance

2007-12-23 Thread Christian Heimes
Christian Heimes added the comment: No, it's too confusing for users and it might hide bugs. The core types either change an object in place and return None *OR* the method returns a modified object. It's a design decision we won't change. In your case you can use the reversed(range(10))