Robert Bradshaw wrote:
> On Oct 13, 2008, at 1:44 PM, Dag Sverre Seljebotn wrote:
>> For more brevity without typing all the " there's always the
>> Point(color=...), syntax
Which, as I only noticed now, actually matches the way named tuples are used.
>> and I feel being consistent with keeping
>> it a normal dict is important because a later feature might be
>>
>> cdef Point p
>> d = {"color": color, "x" : x, "y" : y}
>> p = d
>
> Yes, that's certainly in the plans.
That certainly matches the opposite conversion way, which, as I see in the
test, you already implemented.
Given this goal, I wonder why the literals are needed in the first place.
Currently, you can just do this:
p = Point(color=color, x=y)
and once dict unpacking is implemented, you can also do
p = dict(color=color, x=y)
or
p = {"color" : color, "x" : y}
where the dict creation could even be optimised away, at least in the
trivial case.
Adding another literal syntax to this, only for the sake of removing one
little name before the parentheses, seems unnecessary to me.
Apart from this little detail, I'm very happy with the general concepts
and I really like what you implemented here. This totally makes sense in
the context of Cython.
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev