Python rocks

Mark Carter me at privacy.net
Sun Jun 3 10:45:36 CEST 2007


Alex Martelli wrote:
> Josiah Carlson <josiah.carlson at sbcglobal.net> 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.

Actually, that'd be nice to have in Python. And whilst we're about it, 
might as well go the whole hog and allow hyphens in names, too.



More information about the Python-list mailing list