Top "Introspection" questions

A capability of some object-oriented programming languages to determine the type of an object at runtime.

How do I check if a variable is an instance of a class?

In Java, you can do instanceof. Is there a Ruby equivalent?

ruby inheritance introspection
How to list all fields of a class (and no methods)?

Suppose o is a Python object, and I want all of the fields of o, without any methods or __stuff__. …

python python-2.7 introspection
Java introspection: object to map

I have a Java object obj that has attributes obj.attr1, obj.attr2 etc. The attributes are possibly accessed through …

java introspection
Get an object properties list in Objective-C

How can I get a list (in the form of an NSArray or NSDictionary) of a given object properties in …

objective-c class properties attributes introspection
Swift class introspection & generics

I am trying to dynamically create a class instance based type using generics, however I am encountering difficulty with class …

introspection swift
Convert object's properties and values to array of key value pairs

I'm fairly new to JavaScript and am not sure this is possible to do but basically I would like to …

javascript reflection introspection
Get __name__ of calling function's module in Python

Suppose myapp/foo.py contains: def info(msg): caller_name = ???? print '[%s] %s' % (caller_name, msg) And myapp/bar.…

python stack-trace introspection
Java introspection and reflection

Can any one explain the use of Java reflection and introspection? When we need to use both?

java reflection introspection
How can I determine the type of a generic field in Java?

I have been trying to determine the type of a field in a class. I've seen all the introspection methods …

java generics reflection types introspection
Can you list the keyword arguments a function receives?

I have a dict, which I need to pass key/values as keyword arguments.. For example.. d_args = {'kw1': …

python arguments introspection