Add one more point about the benefits of a generic construct

This commit is contained in:
Antoine Pitrou 2013-09-14 22:11:52 +02:00
parent 65665926ae
commit b79d081178
1 changed files with 4 additions and 0 deletions

View File

@ -170,6 +170,10 @@ rather than a specialized case-insensitive dict variant. The answer
is that it's nearly as cheap (code-wise and performance-wise) to provide
the generic construct, and it can fill more use cases.
Even case-insensitive dicts can actually elicit different transformation
functions: ``str.lower``, ``str.casefold`` or in some cases ``bytes.lower``
when working with text encoded in a ASCII-compatible encoding.
Other constructor patterns
--------------------------