Skip to content

Re-opening #8255: hexadecimal default arguments are changed to decimal #9781

@mara004

Description

@mara004

Describe the bug

I am experiencing the exact same problem as described in #8255: hexadecimal default arguments are changed to decimal.

How to Reproduce

Autodoc the following function:

def some_function(
        param_a,
        param_b,
        *,  # enforce keyword arguments from this point onwards
        background_colour: int = 0xFFFFFFFF,
        # ... other optional parameters
    ):
    pass

HTML result looks like this

background_colour: int = 4294967295

Expected behavior

Hexadecimal defaults should not be converted to decimal, or at least there should be an option to enforce this behaviour.

Your project

I'm afraid this is private

Screenshots

No response

OS

Linux Ubuntu 20.04

Python version

3.8.10

Sphinx version

4.2.0

Sphinx extensions

autodoc, intersphinx, napoleon

Extra tools

Chromium 94

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions