[IronPython] [AVG SPAM] inheriting from "base" generic type

Dino Viehland dinov at exchange.microsoft.com
Mon Mar 17 17:12:59 CET 2008

I'm guessing you missed Jim's talk otherwise you would have seen my demo :)

But anyway I'm still here - I'm down in Kitty Hawk working on making Django's latest and greatest work.  I'm here tomorrow too and leave Wednesday morning.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steve Holden
Sent: Monday, March 17, 2008 3:21 AM
To: Discussion of IronPython
Subject: Re: [IronPython] [AVG SPAM] inheriting from "base" generic type

Dino's at PyCon? Shit, this conference is getting too large!

If you're still here, Dino (and Ronnie too, come to that) try and find
me to say hello.


Ronnie Maor wrote:
> Hi Dino,
> asked you about this at pycon. posting it here per our discussion to
> help track it.
> I understand it's not high on your priority list (and shouldn't be,
> considering the other stuff there)
> details:
> have a python class (simplified here) that is a wrapper over an event:
> class Future(object):
>     def set(self,val) # set from one thread
>     def get(self) # blocking until set. returns the value set.
> I exposed the class to C# code through a template interface:
> interface IFuture<T>
>     void set(T val)
>     T get()
> the interaction in our case is that C# calls python, which returns a
> future, which C# then waits on:
> interface MyPythonSubsystem:
>     IFuture<int> get_an_int()
> Ideally I'd say that Future implements IFuture<T> for any T, by having
> Future inherit from IFuture in python. I hoped this would mean
> IronPython would accept my Future object when I returned it from the
> python implementation of get_an_int().
> Unfortunately, this isn't possible, and I could only inherit from
> IFuture[T] for some specific T.
> Ended up writing a simple function at the boundary between the
> subsystems which gets T as an argument, and constructs an adapter that
> inherits from IFuture<T> and proxies to an underlying Future object. It
> works fine for our case, but less than pretty :-(
> anyway, hope this helps document/track it
> Ronnie
> ------------------------------------------------------------------------
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

Users mailing list
Users at lists.ironpython.com

More information about the Ironpython-users mailing list