[Python-Dev] PEP 455: TransformDict (original) (raw)
Ryan Gonzalez rymg19 at gmail.com
Mon Oct 7 23:10:39 CEST 2013
- Previous message: [Python-Dev] PEP 455: TransformDict
- Next message: [Python-Dev] PEP 455: TransformDict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
100% disagreement. Err, well, 50%.
A property of existing dictionaries is useless. A separate object in, say, collections is more organized.
3rd party libraries can be hard to find, even the great ones.
On Mon, Oct 7, 2013 at 3:01 PM, Russell E. Owen <rowen at uw.edu> wrote:
In article <C4C036B6-130C-4718-BEB1-A7C9230082F4 at gmail.com>, Raymond Hettinger <raymond.hettinger at gmail.com> wrote:
> On Sep 22, 2013, at 6:16 PM, Ethan Furman <ethan at stoneleaf.us> wrote: > > > Are we close to asking for pronouncement? > > When you're ready, let me know. > > In the meantime, I conducting usability tests on students in Python classes > and researching how well it substitutes for existing solutions for > case insensitive dictionaries (the primary use case) and for other > existing cases such as dictionaries with unicode normalized keys. > > If you want to participate in the research, I could also use help looking > at what other languages do. Python is not the first language with > mappings or to encounter use cases for transforming keys prior > to insertion and lookup. I would like to find out what work has > already been done on this problem. > > Another consideration is whether the problem is more general > that just dictionaries. Would you want similar functionality in > all mapping-like objects (i.e. a persistent dictionaries, os.environ, etc)? > Would you want similar functionality for other services > (i.e. case-insensitive filenames or other homomorphisms). > > You can also add to the discussion by trying out your own usability > tests on people who haven't been exposed to this thread or the pep. > > My early results indicate that the API still needs work. > >... > * Another issue is that we're accumulating too many dictionary > variants and that is making it difficult to differentiate and choose > between them. I haven't found anyone (even in advanced classes > with very experienced pythonistas) would knew about > all the variations: dict, defaultdict, Mapping, MutableMapping, > mapping views, OrderedDict, Counter, ChainMap, andTransformDict. I agree. I personally think being able to transform keys would be much more useful as a property of existing dictionaries. I often use case-insensitive keys. But I use them with dict and OrderedDict (and probably ought to use defaultdict, as well). TransformDict is neat, but I'd personally be happier seeing this as a 3rd party library for now. -- Russell
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com
-- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20131007/b818e8ee/attachment.html>
- Previous message: [Python-Dev] PEP 455: TransformDict
- Next message: [Python-Dev] PEP 455: TransformDict
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]