# 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: 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.verygoodsecurity.com/vault/developer-tools/larky/library-api/reprlib.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.
