@@ -671,8 +671,8 @@ are always available. They are listed here in alphabetical order.
671
671
.. function :: hex(x)
672
672
673
673
Convert an integer number to a lowercase hexadecimal string prefixed with
674
- "0x". If x is not a Python :class: `int ` object, it has to define an
675
- __index__() method that returns an integer. Some examples:
674
+ "0x". If * x * is not a Python :class: `int ` object, it has to define an
675
+ :meth: ` __index__ ` method that returns an integer. Some examples:
676
676
677
677
>>> hex (255 )
678
678
'0xff'
@@ -730,12 +730,10 @@ are always available. They are listed here in alphabetical order.
730
730
int(x, base=10)
731
731
732
732
Return an integer object constructed from a number or string *x *, or return
733
- ``0 `` if no arguments are given. If *x * is a number, return
734
- :meth: `x.__int__() <object.__int__> `. If *x * defines
735
- :meth: `x.__trunc__() <object.__trunc__> ` but not
736
- :meth: `x.__int__() <object.__int__> `, then return
737
- :meth: `x.__trunc__() <object.__trunc__> `. For floating point numbers,
738
- this truncates towards zero.
733
+ ``0 `` if no arguments are given. If *x * defines :meth: `__int__ `,
734
+ ``int(x) `` returns ``x.__int__() ``. If *x * defines :meth: `__trunc__ `,
735
+ it returns ``x.__trunc__() ``.
736
+ For floating point numbers, this truncates towards zero.
739
737
740
738
If *x * is not a number or if *base * is given, then *x * must be a string,
741
739
:class: `bytes `, or :class: `bytearray ` instance representing an :ref: `integer
0 commit comments