[Python-ideas] crazy ideas

Josiah Carlson jcarlson at uci.edu
Tue May 22 21:33:45 CEST 2007


"Aaron Brady" <castironpi at comcast.net> wrote:
> > > s = s[a,b,c]
> > >
> > > for
> > >
> > > s = set([a,b,c])
> > 
> > Would you be happy with {a, b, c}?
> > 
> Yes, impartiality being hard to come by.
> 
> Is it a deque or a set?  d{a,b,c} could allow you flexibility.

It's the set syntax for Python 3.0.  Getting deque syntax, or a prefix
for arbitrary types that are rarely used is not going to happen.  There
was already huge resistance to the set syntax, and those are used easily
10 times more than deques.

In terms of having a syntax for deques, I honestly don't see the problem
with deque([a,b,c]).  It has all of 6 more characters to type than your
proposed d{a,b,c} syntax, without cluttering up the language with yet
another bit of syntax that can be replaced with a 2 line function...

def d(*args):
    return deque(args)

Repeat this to yourself until you realize that it's the only sane
approach to Python language design: not every X line function should be
made into a builtin or syntax.

 - Josiah




More information about the Python-ideas mailing list