Python slang

Marco Sulla mail.python.org at marco.sulla.e4ward.com
Fri Aug 5 18:00:56 EDT 2016


I have a simple curiosity: why Python has much keywords, and some
builtin types and methods, that are different from the other
languages? What is the rationale?

I'm referring to:
* `except` instead of `catch`
* `raise` instead of `throw`
* `self` instead of `this` (I know, it's not enforced, but it's a de
facto standard and some IDEs like PyDev gives you an error if you
declare a non-static method without `self` as first parameter)
* `dict` instead of `map`
* `list.append()` instead of `list.push()`
* `str.strip()` instead of `str.trim()`
* `True`, `False` and None instead of `true`, `false` and `none` (they
seems classes)
* and furthermore much abbreviation, like `str` instead of `string`
and `len()` instead of `length()`, that seems to contrast with the
readability goal of Python.

I don't ask about `None` instead of `null` because I suppose here it's
a matter of disambiguation (null, in many languages, is not equal to
null).



More information about the Python-list mailing list