@@ -657,8 +657,8 @@ are always available. They are listed here in alphabetical order.
657
657
.. function :: hex(x)
658
658
659
659
Convert an integer number to a lowercase hexadecimal string prefixed with
660
- "0x". If x is not a Python :class: `int ` object, it has to define an
661
- __index__() method that returns an integer. Some examples:
660
+ "0x". If * x * is not a Python :class: `int ` object, it has to define an
661
+ :meth: ` __index__ ` method that returns an integer. Some examples:
662
662
663
663
>>> hex (255 )
664
664
'0xff'
@@ -716,12 +716,10 @@ are always available. They are listed here in alphabetical order.
716
716
int(x, base=10)
717
717
718
718
Return an integer object constructed from a number or string *x *, or return
719
- ``0 `` if no arguments are given. If *x * is a number, return
720
- :meth: `x.__int__() <object.__int__> `. If *x * defines
721
- :meth: `x.__trunc__() <object.__trunc__> ` but not
722
- :meth: `x.__int__() <object.__int__> `, then return
723
- :meth: `x.__trunc__() <object.__trunc__> `. For floating point numbers,
724
- this truncates towards zero.
719
+ ``0 `` if no arguments are given. If *x * defines :meth: `__int__ `,
720
+ ``int(x) `` returns ``x.__int__() ``. If *x * defines :meth: `__trunc__ `,
721
+ it returns ``x.__trunc__() ``.
722
+ For floating point numbers, this truncates towards zero.
725
723
726
724
If *x * is not a number or if *base * is given, then *x * must be a string,
727
725
:class: `bytes `, or :class: `bytearray ` instance representing an :ref: `integer
0 commit comments