Greg Ewing wrote:
> Neal Norwitz wrote:
>
>> I'm mostly convinced that using PyObjects would be a good thing.
>> However, making the change isn't free as all the types need to be
>> created and this is likely quite a bit of code.
>
> Since they're all so similar, perhaps they could be
> auto-generated by a fairly simple script?
>
> (I'm being very careful not to suggest using Pyrex
> for this, as I can appreciate the desire not to make
> such a fundamental part of the core dependent on it!)
The ast C structs are already auto-generated by a Python script (asdl_c.py, to
be precise). The trick is to make that script generate full PyObjects rather
than the simple C structures that it generates now.
I believe Jeremy wrote that early in the life of the AST branch, so it's worth
waiting for his advice on how to go about modifying it.
asdl_seq can disappear entirely: we can just use a PyList instead.
The second step is to then modify ast.c to use the new structures. A branch
probably wouldn't help much with initial development (this is a "break the
world, check in when stuff compiles again" kind of change, which is hard to
split amongst multiple people), but I think it would be of benefit when
reviewing the change before moving it back to the trunk.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com