On 09/11/2013 02:38 AM, Serhiy Storchaka wrote:
There is a question about specifying the transform function.

There are three ways to do this:

1. Positional argument of the constructor.

d = TransformDict(str.casefold, Foo=5)

This method follows the precedent of defaultdict:

--> from collections import defaultdict
--> l = defaultdict(list, foo=['ham','eggs'])
--> l
defaultdict(<class 'list'>, {'foo': ['ham', 'eggs']})

Without a compelling reason to change, we should keep it consistent.

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to