[IronPython] What's the situation on being able to accept patches?

Dan Eloff dan.eloff at gmail.com
Mon Oct 13 15:49:07 PDT 2008


On Mon, Oct 13, 2008 at 3:50 PM, Dino Viehland <dinov at microsoft.com> wrote:
> In the mean time I would assume you just need the FunctionDefinition and Expression exposed off of GeneratorExpression.  Is that right or is it something else?  I should be able to do that for RC1.
>

That's initially what I did, but exposing an optimization in a public
interface did not sit well with me. I thought ideally it should offer
the same public interface as a ListComprehension node, so I
implemented that. Benefit is it provides a consistent interface to
users of the IronPython ast (me included). I'm attaching the modified
.cs file here, you can use it as a reference if you decide to take
that approach.

> For compile I think you could back-patch the built-in modules.  You can add a [SpecialName] void PerformModuleReload(PythonContext, IAttributeCollection) method to your module to know when it gets imported/reloaded and you can then patch builtin.compile with a version of your own which calls the built-in version.

I like the sound of that. It could be possible for people to use _ast
with an official IronPython 2.0 distribution. I've seen the
PerformModuleReload around in the source code, but I'm not clear on
how to replace the builtin compile from there. If you could give me a
brief example I can fix my code to work that way.

Thanks,

-Dan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: GeneratorExpression.cs
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20081013/1042f09b/attachment-0001.txt>


More information about the Users mailing list