]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
tooling: write_pyi.py: filter usage of raw-strings (rstrings)
authorJames Addison <james@reciperadar.com>
Mon, 10 Apr 2023 19:40:38 +0000 (15:40 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 12 Apr 2023 20:36:39 +0000 (22:36 +0200)
commitd3f869bb3159d18669fb6f00cbe514307118eea7
tree32b83d276b3eaf779dcea37aa1c59e0b0da5e596
parent33a9947686a7c8bb3becd6169ec7abe84cf2c7e6
tooling: write_pyi.py: filter usage of raw-strings (rstrings)

### Description
While reading the diff between [`rel_1_10_2...rel_1_10_3`](https://github.com/sqlalchemy/alembic/compare/rel_1_10_2...rel_1_10_3), the introduction of r-strings drew my attention, and that resulted in some [discussion on the relevant commit](https://github.com/sqlalchemy/alembic/commit/bc0c305b7c2cc0401e250fcd6a725aacecdd6e33).

This changeset filters the production of r-strings during stub-generation to cases where docstrings contain escape (backslash, `\`) characters.

I'll admit that I didn't realize until today that these stubs are primarily for typechecking.  Since that's the case, I have doubts about whether the change is worthwhile (consistency and simplicity -- using r-strings for all docstrings in the stubs -- even if it's redundant, seems fine to me).

### Checklist
This pull request is:

- [x] A documentation / typographical error fix
- [x] A short code fix
- Relates to discussion at https://github.com/sqlalchemy/alembic/commit/bc0c305b7c2cc0401e250fcd6a725aacecdd6e33

Closes: #1218
Pull-request: https://github.com/sqlalchemy/alembic/pull/1218
Pull-request-sha: 352ab8829525435f78838687e12156a3fa3a3d86

Closes: #1219
Pull-request: https://github.com/sqlalchemy/alembic/pull/1219
Change-Id: I2808a592681dabc093d538f589e673fcc5e05822
alembic/context.pyi
alembic/op.pyi
alembic/operations/ops.py
setup.cfg
tools/write_pyi.py