#11081·ipython

`?` shows docstring for wrong function.

Author: enedilCreated Apr 8, 2018Updated Aug 16, 2026
Labelsbugmagics

Hi.

Try this code in IPython shell:

python
In [1]: float.hex?
Docstring:
float.hex() -> string

Return a hexadecimal representation of a floating-point number.
>>> (-0.1).hex()
'-0x1.999999999999ap-4'
>>> 3.14159.hex()
'0x1.921f9f01b866ep+1'
Type:      method_descriptor

In [2]: (1.0).hex?
Signature: hex(number, /)
Docstring:
Return the hexadecimal representation of an integer.

>>> hex(12648430)
'0xc0ffee'
Type:      builtin_function_or_method

Obviously, second one is wrong (the docs are valid for built-in hex function, not float.hex).

My config:

Python 3.6.4 (default, Mar 13 2018, 18:18:20) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

OS: Fedora 27, upgraded, Python (and iPython) installed from Fedora repositories.