|
3932 | 3932 | """))
|
3933 | 3933 |
|
3934 | 3934 |
|
3935 |
| -tobytesdoc = """ |
3936 |
| - a.{name}(order='C') |
| 3935 | +add_newdoc('numpy.core.multiarray', 'ndarray', ('tobytes', """ |
| 3936 | + a.tobytes(order='C') |
3937 | 3937 |
|
3938 | 3938 | Construct Python bytes containing the raw data bytes in the array.
|
3939 | 3939 |
|
|
3943 | 3943 | unless the F_CONTIGUOUS flag in the array is set, in which case it
|
3944 | 3944 | means 'Fortran' order.
|
3945 | 3945 |
|
3946 |
| - {deprecated} |
| 3946 | + .. versionadded:: 1.9.0 |
3947 | 3947 |
|
3948 | 3948 | Parameters
|
3949 | 3949 | ----------
|
3950 |
| - order : {{'C', 'F', None}}, optional |
| 3950 | + order : {'C', 'F', None}, optional |
3951 | 3951 | Order of the data for multidimensional arrays:
|
3952 | 3952 | C, Fortran, or the same as for the original array.
|
3953 | 3953 |
|
|
3966 | 3966 | >>> x.tobytes('F')
|
3967 | 3967 | b'\\x00\\x00\\x02\\x00\\x01\\x00\\x03\\x00'
|
3968 | 3968 |
|
3969 |
| - """ |
| 3969 | + """)) |
| 3970 | + |
| 3971 | + |
| 3972 | +add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring', r""" |
| 3973 | + a.tostring(order='C') |
| 3974 | +
|
| 3975 | + A compatibility alias for `tobytes`, with exactly the same behavior. |
| 3976 | +
|
| 3977 | + Despite its name, it returns `bytes` not `str`\ s. |
| 3978 | +
|
| 3979 | + .. deprecated:: 1.19.0 |
| 3980 | + """)) |
3970 | 3981 |
|
3971 |
| -add_newdoc('numpy.core.multiarray', 'ndarray', |
3972 |
| - ('tostring', tobytesdoc.format(name='tostring', |
3973 |
| - deprecated= |
3974 |
| - 'This function is a compatibility ' |
3975 |
| - 'alias for tobytes. Despite its ' |
3976 |
| - 'name it returns bytes not ' |
3977 |
| - 'strings.'))) |
3978 |
| -add_newdoc('numpy.core.multiarray', 'ndarray', |
3979 |
| - ('tobytes', tobytesdoc.format(name='tobytes', |
3980 |
| - deprecated='.. versionadded:: 1.9.0'))) |
3981 | 3982 |
|
3982 | 3983 | add_newdoc('numpy.core.multiarray', 'ndarray', ('trace',
|
3983 | 3984 | """
|
|
0 commit comments