From b79d0811787c6b3a9b6d922fc0cdfd838ec81327 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 14 Sep 2013 22:11:52 +0200 Subject: [PATCH] Add one more point about the benefits of a generic construct --- pep-0455.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pep-0455.txt b/pep-0455.txt index 0a2789731..f92596aeb 100644 --- a/pep-0455.txt +++ b/pep-0455.txt @@ -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 --------------------------