# The Python IAQ

DevFeed: [The Python IAQ](<https://devfeed.tech/articles/the-python-iaq-40582.md>)

Original publisher: [Read original article](<http://norvig.com/python-iaq.html>)

Published: 2005-08-08T00:00:00Z

Content type: article

Language: en

Sources: [Peter Norvig](<https://devfeed.tech/sources/peter-norvig.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [IPython](<https://devfeed.tech/topics/ipython.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [apply](<https://devfeed.tech/tags/apply.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [array](<https://devfeed.tech/tags/array.md>), [bjarne-stroustrup](<https://devfeed.tech/tags/bjarne-stroustrup.md>), [boolean](<https://devfeed.tech/tags/boolean.md>), [boolean-type](<https://devfeed.tech/tags/boolean-type.md>), [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [collections](<https://devfeed.tech/tags/collections.md>), [complex](<https://devfeed.tech/tags/complex.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [conditional](<https://devfeed.tech/tags/conditional.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [counter](<https://devfeed.tech/tags/counter.md>), [python](<https://devfeed.tech/tags/python.md>), [questions](<https://devfeed.tech/tags/questions.md>)

## AI overview

The Python IAQ collects obscure Python questions whose answers can matter in practice, and notes that many answers have changed as Python evolved. Its examples explain that `finally` runs after `try` unless execution never reaches it; sorting requires elements with a usable `__lt__` (complex numbers cannot be ordered this way); and method calls are function calls combined with attribute lookup, allowing normal argument unpacking. It covers practical alternatives such as `collections.namedtuple`, `defaultdict`, `Counter`, conditional expressions, and `enum`, while distinguishing Python's calling and printing conventions from Java and C++. The author favors clearly separating statements from expressions as the reason Python lacks `x++`, and warns that a homemade `printf` can misinterpret literal percent signs. Mutable string options are presented as imperfect choices. The page dates to 2000 and refers to older Python versions, so its examples and claims are not a complete guide to current Python.

## Source excerpt

Infrequently Answered Questions for Python