Stefan Behnel wrote:
> Robert Bradshaw, 24.03.2010 15:40:
>> On Mar 22, 2010, at 1:51 PM, Stefan Behnel wrote:
>>> IIRC, the PEP suggests the use of tuples to provide multiple
>>> annotations.
>> We should support that then.
> 
> Actually, it doesn't. I don't remember where I read that, then. I couldn't 

It might have been a cython-dev post by me (just as a proposal well over 
a year ago).

> find any reference to a preferred usage of multiple annotations now that I 
> looked for it. I guess that'll just have to emerge over time then. So far, 
> there's certainly too few people using it.
> 
> Anyway, I think that at this time, supporting both a plain annotation as 
> well as a tuple of several annotations is the only sensible way of 
> supporting annotations in a cooperative way. New ways of providing more 
> than one annotation can always be added to that later on.

My proposal was that one would have a tuple (cython_type, inner), which 
would be replaced by inner after Cython had processed it, so that Cython 
could work with "bad citizens" which expected the annotations all for 
themselves. (Hence the decorator notation.)

However I like your proposal much, much better -- better to encourage 
good practices; we can always add another, more inconvenient method if 
compatability with bad citizens are needed. Also documentation tools 
etc. could very well make use of Cython annotations run-time.

I vote for making C style declarations available in __annotations__ as 
well...

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to