If by "DLR object" you mean an object which has dynamic behavior beyond just
it's type you can check to see if it implements IDynamicObject. But there
really isn't anything considered to be a "DLR object". They're all just CLR
objects and some of them can have dynamic behavior. Even normal CLR objects
could have behaviors beyond just their normal CLR type - for example the
various methods we add onto .NET strings that match the Python built-in string
members. But I think IDynamicObject will probably get you the answer you're
looking for.
________________________________
From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Curt Hagenlocher [EMAIL
PROTECTED]
Sent: Wednesday, January 30, 2008 3:15 PM
To: Discussion of IronPython
Subject: [IronPython] Distinguishing DLR object from CLR object
Is there a straightforward and reliable way from within IronPython to tell if a
particular object is a "CLR object' or a "DLR object"? I can make a guess for
just IronPython by saying
isPythonObject = clr.GetClrType(type(obj)).FullName.startswith('IronPython')
but this is both ugly and unreliable.
--
Curt Hagenlocher
[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com