Greg Ewing wrote:
> A compromise might be
>
> cdef Point p = {color = color, x = x, y = y}
Yes, keywords were my first thought as well. They heavily reduce the
magic. I just wasn't sure if {} is the syntax of choice here, or if
(colour=5, x=y) would match my intuition better. It matches the new
constructor after all.
Another thought I had was that this should somehow match named tuples (new
in Py2.6), but there isn't a literal syntax for them, so this won't help
much. That makes keywords the next best choice, IMHO.
http://code.activestate.com/recipes/500261/
http://docs.python.org/library/collections.html#collections.namedtuple
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev