Skip to content

Syntax warnings because of escape characters in the docstrings #536

Open
@jihaekor

Description

@jihaekor

Hello Team,

I am running into some syntax warnings (I guess these are DeprecationWarnings in the earlier Python versions, based on what I am reading) when attempting to run on Python 3.12 because of invalid escape characters in the docstrings. I know that 3.12 isn't officially supported, but I thought that I would bring this up as this will likely come up in the future anyways, and because it only involves the docstrings and not the actual code.

An example is this line:
https://github.com/Trusted-AI/AIF360/blob/main/aif360/sklearn/inprocessing/infairness.py#L265

with the below message:

invalid escape sequence '\e'

Related Stack Overflow topic:
https://stackoverflow.com/questions/77531208/python3-12-syntaxwarning-on-triplequoted-string-d-must-be-d

From the above, it looks like either the docstring should be a literal string (r""" ...), or be replaced with double slashes rather than a single.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions