# isinstance()

## isinstance()

```python
class A:
	pass

class B(A):
	pass

class C(B):
	pass

c = C()
print(isinstance(c, A))
```

Output: Evaluates to True

The 'isinstance()' function checks if the object (first argument) is an instance or subclass of the class (second argument). Although object c is derived from class C but class C inherits from B which in turn inherits from A, hence c will be considered an instance of A. Consider it like your family tree. You will be considered related to your Great Grand Parents even though you are not directly their child.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/programming/python/classic-python/isinstance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
