On Oct 13, 2008, at 1:44 PM, Dag Sverre Seljebotn wrote: > I'm sorry to bring this up as people would rather code and discuss > other > stuff, but, well, once things are released they tend to stick. So I'll > just raise the concern and you do what you want to do...
No, it is good to bring this up now. In fact, I would encourage everyone to look at http://hg.cython.org/cython-devel/file/5a7f83a639f7/tests/run/ struct_conversion.pyx and say what they think. > My concern is about the dict struct construction syntax -- from > "struct_conversion.pyx": > > cdef Point p = {color: color, x: x, y: y} > > That is, without string keys, but rather some magic keys. This feels > very odd to a Python eye -- especially as the coercion the other way > (from struct to dict) seems to have normal string keys. As a (weak) counter argument, I found myself forgetting the quotes when testing, and it's not much more magic than the magic string kwds arguments keys. > For more brevity without typing all the " there's always the > Point(color=...), syntax, 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. > and then these "literal dict vs. Python dict" kind of thing might be > even more confusing. Point taken. I'm not too attached to this syntax--lets see if anyone else has feedback. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
