Skip to content

Commit 134d290

Browse files
GiacomoPopetscrim
andauthored
Apply suggestions from code review
Co-authored-by: Travis Scrimshaw <[email protected]>
1 parent b06f95c commit 134d290

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/sage/rings/finite_rings/element_base.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ cdef class FinitePolyExtElement(FiniteRingElement):
11111111
integer_representation = deprecated_function_alias(33941, to_integer)
11121112

11131113
def to_bytes(self, byteorder="big"):
1114-
"""
1114+
r"""
11151115
Return an array of bytes representing an integer.
11161116
11171117
Internally relies on the python ``int.to_bytes()`` method.

src/sage/rings/integer.pyx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7164,16 +7164,15 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
71647164
raise ValueError("algorithm must be one of: 'pari' or 'gmp' (alias: 'mpir')")
71657165

71667166
def to_bytes(self, length=1, byteorder="big", is_signed=False):
7167-
"""
7167+
r"""
71687168
Return an array of bytes representing an integer.
71697169
71707170
Internally relies on the python ``int.to_bytes()`` method.
71717171
71727172
INPUT:
71737173
71747174
- ``length`` -- positive integer (default: ``1``); integer is represented in
7175-
``length`` bytes. ``OverflowError`` is raised if the integer is not representable
7176-
with the given length.
7175+
``length`` bytes
71777176
71787177
- ``byteorder`` -- str (default: ``"big"``); determines the byte order of
71797178
the output; can only be ``"big"`` or ``"little"``
@@ -7185,9 +7184,11 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
71857184
71867185
- Bytes representing ``self``
71877186
7188-
.. TODO:: It should be possible to convert straight from the gmp type in cython.
7189-
This could be significantly faster, but I am unsure of the fastest and cleanest
7190-
way to do this.
7187+
.. TODO::
7188+
7189+
It should be possible to convert straight from the gmp type in cython.
7190+
This could be significantly faster, but I am unsure of the fastest and cleanest
7191+
way to do this.
71917192
71927193
EXAMPLES::
71937194

0 commit comments

Comments
 (0)