[IronPython] 2.0B1 Hosting: Creating Python Types

Dino Viehland dinov at exchange.microsoft.com
Wed Mar 19 16:40:13 PDT 2008


In general you shouldn't need access to CodeContext for doing anything - unless you're writing an API which will be consumed by script code.  And the hosting APIs don't expose CodeContext instances so it can be challenging to get one without jumping through hoops.

Obviously there's a bunch of things people want to do that are Python specific and aren't covered by the DLR hosting APIs.  It'd be interesting to collect all of those things so that we can make sure we get all of the features that people want.

So far I think the interesting ones would include:
        file
        exception info
        module access (built-ins at least and possibly Python modules)
        type caller (which will actually going away, so no big deal there, but might be worth a discussion)

There's also some cleanup here for example creating ScriptScope's from the DLR doesn't give you a very usable Python module but we'll be fixing that.

Are there other things that jump out at people as missing?  Also, is there much interest in a 1.1 compatible hosting API or should we just expose this additional functionality?

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher
Sent: Wednesday, March 19, 2008 12:15 PM
To: Discussion of IronPython
Subject: Re: [IronPython] 2.0B1 Hosting: Creating Python Types

On Mon, Mar 17, 2008 at 5:26 PM, Dino Viehland
<dinov at exchange.microsoft.com> wrote:
>
> CodeContext isn't actually internal but it's also not available to you via the
> hosting APIs.

Does this mean that we shouldn't be creating CodeContexts?  I'm using
the class "IronPython.Runtime.Operations.PythonTypeOps+TypeCaller" to
construct new objects from Python types.  This process requires a
CodeContext, which I'm currently building from scratch as needed.

(The same approach could be used with the PythonType
"IronPython.Runtime.Builtin.file" in order to build a Python file
object a little more efficiently.)

--
Curt Hagenlocher
curt at hagenlocher.org
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


More information about the Users mailing list