Skip to content

Double backslash escaping #113

@USSX-Hares

Description

@USSX-Hares
def func(s: str):
    """
    Some doc
    
    Examples:
        ```python
        func("C:\\\\Data\\\\foo.bar")
        func("C:\\Data\\foo.bar")
        func('/data/foo.bar')
        ```
    """
    
    pass

__all__ = \
[
    'func',
]

Probably caused by the Python itself, which "eats" backslashes in the triple-quoted string.

print(func.__doc__)

Prints:

    Some doc
    Examples:
        ```python
        func("C:\\Data\\foo.bar")
        func("C:\Data\foo.bar")
        func('/data/foo.bar')
        ```

Expected Behavior

Twice many backslashes.
image

Actual Behavior

image

Additional info

  • pdoc version: 0.6.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis is not a (valid) bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions