Update mathematical-operations.rst

I added a note that the updating-operators can change the type.  This is implicit in the current manual, but it nonetheless threw me for a loop the first time it happened to me (this is different, e.g., from C++), so I thought it should be made explicit.

(cherry picked from commit e244107eb024444c2e29f52953f7e630a62f1942)

Simplify wording and rework example as doctest

(cherry picked from commit 7fdc860b6347461f929f81482715dc747e46865a)

Ref: #8662