You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When documenting a function, which requires a default argument specified in hexadecimal:
.. function:: lcd.print(msg, x, y, color=0xffffff, transparent=False)
Sphinx 3.2.1 will render HTML documentation where the hexadecimal value is in a different number system, than what was specified by the user (decimal), as seen in the following output from the above input:
Expected behavior
The expected behaviour would be to present the default argument in the same radix/number system as the user typed in, thus in this case the documentation would also display the value in hexadecimal.
In the above example of with colors, it is unintuitive what the color 16777215 might refer to, but it's easy read RGB colors in hexadecimal format - e.g. 0xffffff is white, thus which number system is used can make a huge difference. The same for example goes for e.g. specifying access rights for files (chmod)
Screenshots
Environment info
OS: Mac OS X 10.14.6
Python version: 3.8.5
Sphinx version: 3.2.1
Sphinx extensions: None
Extra tools: None
The text was updated successfully, but these errors were encountered:
Number literals in default argument value is converted to decimal form
unexpectedly by AST module. This fixes the signature parsing code to
recosntruct it correctly.
Note: This is only available in Python 3.8+.
Describe the bug
When documenting a function, which requires a default argument specified in hexadecimal:
Sphinx 3.2.1 will render HTML documentation where the hexadecimal value is in a different number system, than what was specified by the user (decimal), as seen in the following output from the above input:
Expected behavior
The expected behaviour would be to present the default argument in the same radix/number system as the user typed in, thus in this case the documentation would also display the value in hexadecimal.
In the above example of with colors, it is unintuitive what the color 16777215 might refer to, but it's easy read RGB colors in hexadecimal format - e.g. 0xffffff is white, thus which number system is used can make a huge difference. The same for example goes for e.g. specifying access rights for files (
chmod
)Screenshots
Environment info
The text was updated successfully, but these errors were encountered: