[bug][libclang][python] SourceRange.__contains__() returns incorrect value for SourceLocation on same line

Hello Clang Developers,

Apologies if this is not the right place to send this, please feel free to redirect me!

The Bug:

The Python implementation of SourceRange.contains() gives the wrong answer for a SourceLocation on the same line that is strictly after the SourceRange


I’ve attached the full reproducer with this mail, but consider the following snippets

my_file = """
int main()
  int x = 2;
  return x;

# make sourceRange for 'x' in 'int x = 2;'
src_rng = clx.SourceRange.from_locations(
# make sourceLocation for '2' in 'int x = 2;'
src_loc = clx.SourceLocation.from_position(tu,tu.get_file(tu.spelling),4,10)

# to recap, src_loc is definitely not inside src_rng:

[libclangbug.py|attachment](upload://zQ6oGZmyfS3dPK3PdXoN12aZUvZ.py) (1.03 KB)