[Ironruby-core] [IronPython] Telling .NET classes from Python objects
Tomas.Matousek at microsoft.com
Tue Apr 28 14:45:15 EDT 2009
I would recommend not to rely on whether an object is Ruby object or .NET object if possible. You might be surprised to get a COM object, a Python object, DLR expand, etc. if you do so. Use rather respond_to?, include? to ask for specific methods/protocols.
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle
Sent: Tuesday, April 28, 2009 11:10 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] [IronPython] Telling .NET classes from Python objects
Class#to_clr_type? Returns nil for custom Ruby objects... depends on
what you're looking for...
On Tue, Apr 28, 2009 at 1:38 PM, Ivan Porto Carrero <ivan at flanders.co.nz> wrote:
> +1 for this question only I need it to implement different binding
> strategies in IronMVC.
> IronRuby in Action (http://manning.com/carrero)
> Winston Churchill - "The best argument against democracy is a five-minute
> conversation with the average voter."
> On Tue, Apr 28, 2009 at 7:35 PM, Michael Foord <fuzzyman at voidspace.org.uk>
>> Hello guys,
>> I'm continuing my work on generating pi files for the Wing IDE. Actually
>> everything I encounter will be a .NET type, but in general what is the best
>> way of telling if an object is a .NET type or a Python type?
>> Obviously for the primitives it is a moot point - but I'm talking about
>> user defined classes.
>> Users mailing list
>> Users at lists.ironpython.com
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
Ironruby-core mailing list
Ironruby-core at rubyforge.org
More information about the Ironruby-core