Josiah Carlson <[EMAIL PROTECTED]> wrote:

> > pitfall of Python is knowing whether an operation is destructive or not.
> 
> If it returns None, it probably changes the content of an object.

A reasonable heuristic, but with lots of exceptions, alas:
    somedict.get(somekey)
will often return None without performing any change, while
    somelist.pop()
does modify somelist but typically returns non-None.

The use of trailing-exclamation-point (by convention) to indicate
"mutating methods" is a nice plus in languages that allow it.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to