For example, in C# I can do the following using reflection:
public class A
{
object obj1;
[MyCustumAttribute(data)]
public object Obj1Property
{ get; set; }
public A() {}
}
public static void Main(string[] args)
{
Type t = typeof(a);
PropertyInfo[] props = t.GetProperties();
attrs = props[0].GetCustomAttributes();
//Do something with the properties based on their custom attributes
}
Note that I can do the same thing with A's methods, data members, etc. not just on properties.
Is there a way to do this same type of thing in Python 2.7?