[Ironpython-users] Implicit conversion of objects to float

Dino Viehland dinov at microsoft.com
Thu Mar 1 22:59:18 CET 2012


We also might recognize something like op_Power or Power if the method has
[SpecialName] attribute, but I'm not 100% certain if that's still there.  

> -----Original Message-----
> From: ironpython-users-bounces+dinov=microsoft.com at python.org
> [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On
> Behalf Of Jeff Hardy
> Sent: Thursday, March 01, 2012 12:38 PM
> To: Cesar Mello
> Cc: ironpython-users at python.org
> Subject: Re: [Ironpython-users] Implicit conversion of objects to float
> 
> On Thu, Mar 1, 2012 at 12:13 PM, Cesar Mello <cmello at gmail.com> wrote:
> > Hey guys!
> >
> > Just curious: is there a way to implement in the .NET class something
> > that maps to the ** operator?
> 
> You should be able to create a method called __pow__ like so:
>     public object __pow__(object b, object e) { ... }
> 
> Replace object with whatever types you're working with.
> 
> - Jeff
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users




More information about the Ironpython-users mailing list