diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-06-22 18:55:20 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2021-06-22 18:55:20 -0600 |
commit | e07584a1cdb84781c22e90af9ab001d9f1d27f08 (patch) | |
tree | 63f254380c81f09c7108b8ca5b4f35ed4fb6d102 /numpy | |
parent | 80b387c66e4f10faafdb1a21c011c173f77b0942 (diff) | |
download | numpy-e07584a1cdb84781c22e90af9ab001d9f1d27f08.tar.gz |
DOC: Fix some docstrings crash pdf generation.
The byte string output of numpy.Generator.bytes must have the `\`
properly escaped. Also make a small fix to the legacy docstring.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/random/_generator.pyx | 2 | ||||
-rw-r--r-- | numpy/random/mtrand.pyx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx index cd0b24872..e2430d139 100644 --- a/numpy/random/_generator.pyx +++ b/numpy/random/_generator.pyx @@ -585,7 +585,7 @@ cdef class Generator: Examples -------- >>> np.random.default_rng().bytes(10) - b'\xfeC\x9b\x86\x17\xf2\xa1\xafcp' # random + b'\\xfeC\\x9b\\x86\\x17\\xf2\\xa1\\xafcp' # random """ cdef Py_ssize_t n_uint32 = ((length - 1) // 4 + 1) diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx index 863879a04..4f5862faa 100644 --- a/numpy/random/mtrand.pyx +++ b/numpy/random/mtrand.pyx @@ -795,7 +795,7 @@ cdef class RandomState: Examples -------- >>> np.random.bytes(10) - ' eh\\x85\\x022SZ\\xbf\\xa4' #random + b' eh\\x85\\x022SZ\\xbf\\xa4' #random """ cdef Py_ssize_t n_uint32 = ((length - 1) // 4 + 1) # Interpret the uint32s as little-endian to convert them to bytes |