[IronPython] How to get the Type of object

CR Mahesh Mahesh.CR at capco.com
Wed Sep 8 14:10:56 CEST 2004


	Every object in IronPython, like in Python proper, supports a(or
is it some?) intrinsic property for every object created. This is the
__name__ property. You could access it with the normal '.' operator.

	Try the following code, it worked for me.

	>>>from System.Text import *
	>>>s = StringBuilder


-----Original Message-----
From: users-ironpython.com-bounces at lists.ironpython.com
[mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of
Sent: Wednesday, September 08, 2004 5:01 PM
To: users-ironpython.com at lists.ironpython.com
Subject: [IronPython] How to get the Type of object

I would like to know is there any way to get the type of the object.
Actaully my requirement is

      1. First i'll create a object for any C#/.Net Datatype (for
obj = StringBuilder())
	2. Second i may create any other objects are do some operations.
	3. Now, On typing obj(in a taxtbox) and clicking on a button i
have to
identify the ObjectType to which it belongs

users-ironpython.com mailing list
users-ironpython.com at lists.ironpython.com

The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorized. If you are not
an intended recipient, please notify the sender of this email
immediately. You should not copy, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.



More information about the Ironpython-users mailing list