Different types of dicts with letter before the curly braces.

2009-06-14 Thread kindly
I am sure people have thought of this before, but I cant find where. I think that python should adapt a way of defining different types of mapping functions by proceeding a letter before the curly brackets. i.e ordered = o{}, multidict = m{} (like paste multidict). So you could define an

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Mike Kazantsev
On Sun, 14 Jun 2009 04:02:47 -0700 (PDT) kindly kin...@gmail.com wrote: Am I crazy to think this is a good idea? I have not looked deeply pythons grammer to see if it conflicts with anything, but on the surface it looks fine. I'd say on the surface it looks like perl ;) I'd prefer to use

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread kindly
On Jun 14, 12:25 pm, Mike Kazantsev mk.frag...@gmail.com wrote: On Sun, 14 Jun 2009 04:02:47 -0700 (PDT) kindly kin...@gmail.com wrote: Am I crazy to think this is a good idea?  I have not looked deeply pythons grammer to see if it conflicts with anything, but on the surface it looks

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Stefan Behnel
Hi, this kind of stuff is commonly discussed on the python-ideas mailing list. You might want to search that list and/or repost this over there. Stefan kindly wrote: I am sure people have thought of this before, but I cant find where. I think that python should adapt a way of defining

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Mike Kazantsev
On Sun, 14 Jun 2009 04:36:17 -0700 (PDT) kindly kin...@gmail.com wrote: Python already has it for strings rfoo or ubar. So I do not think its going against the grain. flame_war_alert Yes, and there's other syntactic sugar like ; (barely used), mentioned string types, (element,), %s%var or

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Steven D'Aprano
Stefan Behnel wrote: Hi, this kind of stuff is commonly discussed on the python-ideas mailing list. You might want to search that list and/or repost this over there. Please don't top-post here. If the OP takes this idea to python-ideas, chances are he'll be told to take the concept here

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Colin J. Williams
Stefan Behnel wrote: Hi, this kind of stuff is commonly discussed on the python-ideas mailing list. You might want to search that list and/or repost this over there. Stefan kindly wrote: I am sure people have thought of this before, but I cant find where. I think that python should adapt a

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Diez B. Roggisch
The analogy with raw strings is faulty: r changes the way the compiler interprets the characters between the quotes, it doesn't create a different type of object. But u does, as does the new bytestring-literal in Python3. So there is precedent. Diez --

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Aaron Brady
On Jun 14, 4:02 am, kindly kin...@gmail.com wrote: I am sure people have thought of this before, but I cant find where. I think that python should adapt a way of defining different types of mapping functions by proceeding a letter before the curly brackets. i.e   ordered = o{},  multidict =

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread kindly
On Jun 14, 1:59 pm, Steven D'Aprano st...@removethis.cybersource.com.au wrote: Stefan Behnel wrote: Hi, this kind of stuff is commonly discussed on the python-ideas mailing list. You might want to search that list and/or repost this over there. Please don't top-post here. If the OP

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Aaron Brady
On Jun 14, 6:30 am, kindly kin...@gmail.com wrote: On Jun 14, 1:59 pm, Steven D'Aprano snip I am glad the ordered dict will be in 2.7 and 3.1. I was just imagining what would be the next step in definition of structures. New languages like clojure have adopted the dict as top level.  I