> For the complete documentation index, see [llms.txt](https://docs.verygoodsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verygoodsecurity.com/vault/developer-tools/larky/library-api/reprlib.md).

# reprlib

Redo the builtin repr() (representation) but with limits on most sizes.

The reprlib module provides a means for producing object representations with limits on the size of the resulting strings. This is used in the Python debugger and may be useful in other contexts as well.

This module provides a struct, an instance, and a function:

`reprlib.Repr` - struct which provides formatting services useful in implementing functions similar to the built-in repr(); size limits for different object types are added to avoid the generation of representations which are excessively long.

`reprlib.aRepr` - this is an instance of Repr which is used to provide the repr() function described below. Changing the attributes of this object will affect the size limits used by repr() and Python (or in the future, a Larky) debugger.

`reprlib.repr(obj)` - This is the repr() method of aRepr. It returns a string similar to that returned by the built-in function of the same name, but with limits on most sizes.

This diverges from CPython’s `reprlib` in that it does not provide a decorator for detecting recursive calls to **repr**() since Larky does not support recursion.

More here: [module-replib](https://docs.python.org/3/library/reprlib.html#module-reprlib) ported to Larky from: [replib](https://github.com/python/cpython/blob/3.9/Lib/reprlib.py)

## reprlib.Repr()

Repr struct:

Repr instances provide several attributes which can be used to provide size limits for the representations of different object types, and methods which format specific object types.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.verygoodsecurity.com/vault/developer-tools/larky/library-api/reprlib.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
