# How should we mark up multiple types in a type field?

**URL:** <https://discuss.python.org/t/how-should-we-mark-up-multiple-types-in-a-type-field/48196>\
**Category:** Documentation\
**Tags:** sphinx\
**Created:** [March 11, 2024, 1:36pm UTC](https://discuss.python.org/t/how-should-we-mark-up-multiple-types-in-a-type-field/48196 "2024-03-11T13:36:26Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![erlendaasland](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/erlendaasland/32/4378_2.png) [@erlendaasland](https://discuss.python.org/u/erlendaasland)\
**Post date:** [December 11, 2024, 7:17am UTC](https://discuss.python.org/t/how-should-we-mark-up-multiple-types-in-a-type-field/48196/30 "2024-12-11T07:17:10Z")

</div>

> [@guido](#):
>
> Didn’t some PRs get merged that used `or` in some pages?

Some PR got merged where [multiple types where marked up using `|`](https://github.com/python/cpython/blob/12b4f1a5a175d4dcec27631fce2883038f0917ae/Doc/library/tarfile.rst?plain=1#L767-L768) in a `:type:` option up of an `.. attribute::` directive:

In `Doc/library/tarfile.rst`:

```sphinx
.. attribute:: TarInfo.mtime
   :type: int | float

```

When I _initially_ proposed my PR, only _parameters_ (not _attributes_) had such a markup.

My PR proposes to change all the `|`s to `or`.

> [@nedbat](#):
>
> Can you show us what you had hoped would happen, and what is happening instead?

I expected the `:type:` option of `.. attribute::` to be parsed and interpreted exactly as the `:type:` and `:param:` options of `.. class::`, `.. function::`, and `.. method::`. Instead, for the former, Sphinx produces a syntax error.

Read again the OP for more context.

---

_[View the full topic](https://discuss.python.org/t/how-should-we-mark-up-multiple-types-in-a-type-field/48196)._
