[Python] Why does this Python docstring not have newlines in the VS Code hover info?

Discussão em 'Python' iniciado por Stack, Maio 26, 2025.

  1. Stack

    Stack Membro Participativo

    I have this docstring:

    def get_crypto_price(crypto: str, currency: str, max_attempts: int = 3) -> float | None:
    """
    Retrieves the price of a cryptocurrency in a specified currency using the CoinGecko API.

    Args:
    crypto (str): The cryptocurrency to retrieve the price for (e.g., 'bitcoin').
    currency (str): The currency to retrieve the price in (e.g., 'usd').
    max_attempts (int): The maximum number of attempts to make before giving up (default: 3).

    Returns:
    float | None: The price of the cryptocurrency in the specified currency, or None if the price could not be retrieved.
    """


    But it shows up like this in VS Code, with no newline between the currency and max_attempts lines:
    [​IMG]

    How do I get the max_attempts line to be on a new line in the hover info?

    Continue reading...

Compartilhe esta Página