# Hint or advice how to improve docs about \`reprlib.Repr.indent\` feature

**URL:** https://discuss.python.org/t/hint-or-advice-how-to-improve-docs-about-reprlib-repr-indent-feature/15747
**Category:** Documentation
**Created:** [May 14, 2022, 1:07pm UTC](https://discuss.python.org/t/hint-or-advice-how-to-improve-docs-about-reprlib-repr-indent-feature/15747 "2022-05-14T13:07:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![finefoot](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/finefoot/32/7234_2.png) [@finefoot](https://discuss.python.org/u/finefoot)
#### Post date: [May 14, 2022, 1:07pm UTC](https://discuss.python.org/t/hint-or-advice-how-to-improve-docs-about-reprlib-repr-indent-feature/15747/1 "2022-05-14T13:07:48Z")

</div>

This is a pull request I’m currently working on:

> <https://github.com/python/cpython/pull/92735>
>
> \#92734

I appreciate the review and feedback that I received. Unfortunately, I’m not sure how to improve the docs paragraph. I already tried to be as precise as possible. So I was hoping someone with more experience regarding writing docs can give me a hint or advice which sentence needs change and which part can stay the way it is?

Here are the `reprlib.Repr.indent` features that I tried to describe in the docs paragraph:

```auto
>>> from reprlib import aRepr
>>> example = {"one": ["two", "three"], 4: "five"}
>>> aRepr.indent = None
>>> print(aRepr.repr(example))
{'one': ['two', 'three'], 4: 'five'}
>>> aRepr.indent = 2
>>> print(aRepr.repr(example))
{
  'one': [
    'two',
    'three',
  ],
  4: 'five',
}
>>> aRepr.indent = 4
>>> print(aRepr.repr(example))
{
    'one': [
        'two',
        'three',
    ],
    4: 'five',
}
>>> aRepr.indent = "...."
>>> print(aRepr.repr(example))
{
....'one': [
........'two',
........'three',
....],
....4: 'five',
}
>>> 

```

---

<div class="post-metadata">

### Author: ![Ovsyanka](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ovsyanka/32/5891_2.png) [@Ovsyanka](https://discuss.python.org/u/Ovsyanka)
#### Post date: [May 14, 2022, 2:07pm UTC](https://discuss.python.org/t/hint-or-advice-how-to-improve-docs-about-reprlib-repr-indent-feature/15747/2 "2022-05-14T14:07:27Z")

</div>

I’ll post my suggestions for docs refactoring later today. +1 on the feature itself

---

<div class="post-metadata">

### Author: ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)
#### Post date: [May 14, 2022, 5:08pm UTC](https://discuss.python.org/t/hint-or-advice-how-to-improve-docs-about-reprlib-repr-indent-feature/15747/3 "2022-05-14T17:08:33Z")

</div>

Overall, the feature is certainly a very helpful one. Thanks for contributing it!

I left a review with a suggested revision of the added docs, to clarify the text and add examples to illustrate.

Also, a quick manual test of a handful of simple cases for `indent` (`0`, empty string, `True`, `False`, negative integers, and more clearly incompatible types like lists, `object()` and floats) revealed either a bug, potentially unexpected behavior or a less than user-friendly error in each case, which adequate tests coverage of various inputs would help expose. My review provides more detail and recommendations for each.
