---
title: "💭 Using Rich Inspect to interrogate Python objects - Textual"
description: "!https://textual.textualize.io/blog/2023/07/27/using-rich-inspect-to-interrogate-python-objects/"
date: 2023-07-29
published: true
tags:
  - python
  - rich
  - terminal
  - debugging
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://textual.textualize.io/blog/2023/07/27/using-rich-inspect-to-interrogate-python-objects/" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://raw.githubusercontent.com/Textualize/textual/main/imgs/textual.png" alt="Textual - Using Rich Inspect to interrogate Python objects — Textual is a TUI framework for Python, inspired by modern web development." loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">Textual - Using Rich Inspect to interrogate Python objects</div>
      <div class="embed-card-description">Textual is a TUI framework for Python, inspired by modern web development.</div>
      <div class="embed-card-meta">Textual Documentation &middot; textual.textualize.io</div>
    </div>
  </a>
</div>


I love rich inspect.  It's one of my most often used features of rich.  It gives you a great human readable insight into python object instances.

``` python
>>> from rich import inspect
>>> text_file = open("foo.txt", "w")
>>> inspect(text_file)
```

I have a pyflyby entry for it so that I can just run it ang get automatic imports.  To not clash with the standard library inspect, which is quite useful on it's own, I have aliased it to `rinspect`.

``` python
from rich import inspect as rinspect
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
