Skip to content

Commit a6b6f17

Browse files
gh-150285: Fix too long docstrings in the sqlite3 module
1 parent a7d5a6c commit a6b6f17

4 files changed

Lines changed: 72 additions & 70 deletions

File tree

Modules/_sqlite/blob.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ read_multiple(pysqlite_Blob *self, Py_ssize_t length, Py_ssize_t offset)
166166

167167

168168
/*[clinic input]
169-
@permit_long_docstring_body
170169
_sqlite3.Blob.read as blob_read
171170
172171
length: int = -1
@@ -175,14 +174,14 @@ _sqlite3.Blob.read as blob_read
175174
176175
Read data at the current offset position.
177176
178-
If the end of the blob is reached, the data up to end of file will be returned.
179-
When length is not specified, or is negative, Blob.read() will read until the
180-
end of the blob.
177+
If the end of the blob is reached, the data up to end of file will
178+
be returned. When length is not specified, or is negative,
179+
Blob.read() will read until the end of the blob.
181180
[clinic start generated code]*/
182181

183182
static PyObject *
184183
blob_read_impl(pysqlite_Blob *self, int length)
185-
/*[clinic end generated code: output=1fc99b2541360dde input=e5715bcddbcfca5a]*/
184+
/*[clinic end generated code: output=1fc99b2541360dde input=6b745ad37720e556]*/
186185
{
187186
if (!check_blob(self)) {
188187
return NULL;
@@ -235,21 +234,20 @@ inner_write(pysqlite_Blob *self, const void *buf, Py_ssize_t len,
235234

236235

237236
/*[clinic input]
238-
@permit_long_docstring_body
239237
_sqlite3.Blob.write as blob_write
240238
241239
data: Py_buffer
242240
/
243241
244242
Write data at the current offset.
245243
246-
This function cannot change the blob length. Writing beyond the end of the
247-
blob will result in an exception being raised.
244+
This function cannot change the blob length. Writing beyond the end
245+
of the blob will result in an exception being raised.
248246
[clinic start generated code]*/
249247

250248
static PyObject *
251249
blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
252-
/*[clinic end generated code: output=b34cf22601b570b2 input=203d3458f244814b]*/
250+
/*[clinic end generated code: output=b34cf22601b570b2 input=0d372cb0240a5d49]*/
253251
{
254252
if (!check_blob(self)) {
255253
return NULL;
@@ -265,7 +263,6 @@ blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
265263

266264

267265
/*[clinic input]
268-
@permit_long_docstring_body
269266
_sqlite3.Blob.seek as blob_seek
270267
271268
offset: int
@@ -274,14 +271,15 @@ _sqlite3.Blob.seek as blob_seek
274271
275272
Set the current access position to offset.
276273
277-
The origin argument defaults to os.SEEK_SET (absolute blob positioning).
278-
Other values for origin are os.SEEK_CUR (seek relative to the current position)
279-
and os.SEEK_END (seek relative to the blob's end).
274+
The origin argument defaults to os.SEEK_SET (absolute blob
275+
positioning). Other values for origin are os.SEEK_CUR (seek
276+
relative to the current position) and os.SEEK_END (seek relative to
277+
the blob's end).
280278
[clinic start generated code]*/
281279

282280
static PyObject *
283281
blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
284-
/*[clinic end generated code: output=854c5a0e208547a5 input=ee4d88e1dc0b1048]*/
282+
/*[clinic end generated code: output=854c5a0e208547a5 input=84aea1b6b48607dd]*/
285283
{
286284
if (!check_blob(self)) {
287285
return NULL;

Modules/_sqlite/clinic/blob.c.h

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/clinic/connection.c.h

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_sqlite/connection.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,29 +1561,29 @@ pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
15611561
}
15621562

15631563
/*[clinic input]
1564-
@permit_long_docstring_body
15651564
_sqlite3.Connection.set_progress_handler as pysqlite_connection_set_progress_handler
15661565
15671566
cls: defining_class
15681567
progress_handler as callable: object
15691568
A callable that takes no arguments.
1570-
If the callable returns non-zero, the current query is terminated,
1571-
and an exception is raised.
1569+
If the callable returns non-zero, the current query is
1570+
terminated, and an exception is raised.
15721571
/
15731572
n: int
15741573
The number of SQLite virtual machine instructions that are
15751574
executed between invocations of 'progress_handler'.
15761575
15771576
Set progress handler callback.
15781577
1579-
If 'progress_handler' is None or 'n' is 0, the progress handler is disabled.
1578+
If 'progress_handler' is None or 'n' is 0, the progress handler is
1579+
disabled.
15801580
[clinic start generated code]*/
15811581

15821582
static PyObject *
15831583
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
15841584
PyTypeObject *cls,
15851585
PyObject *callable, int n)
1586-
/*[clinic end generated code: output=0739957fd8034a50 input=3ecce6c915922ad4]*/
1586+
/*[clinic end generated code: output=0739957fd8034a50 input=fd0d5abb004f370f]*/
15871587
{
15881588
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
15891589
return NULL;
@@ -1606,6 +1606,7 @@ pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
16061606
}
16071607

16081608
/*[clinic input]
1609+
@permit_long_summary
16091610
_sqlite3.Connection.set_trace_callback as pysqlite_connection_set_trace_callback
16101611
16111612
cls: defining_class
@@ -1619,7 +1620,7 @@ static PyObject *
16191620
pysqlite_connection_set_trace_callback_impl(pysqlite_Connection *self,
16201621
PyTypeObject *cls,
16211622
PyObject *callable)
1622-
/*[clinic end generated code: output=d91048c03bfcee05 input=f4f59bf2f87f2026]*/
1623+
/*[clinic end generated code: output=d91048c03bfcee05 input=edfd7d890200a9cb]*/
16231624
{
16241625
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
16251626
return NULL;
@@ -2212,7 +2213,6 @@ pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
22122213

22132214
#ifdef PY_SQLITE_HAVE_SERIALIZE
22142215
/*[clinic input]
2215-
@permit_long_docstring_body
22162216
_sqlite3.Connection.serialize as serialize
22172217
22182218
*
@@ -2221,15 +2221,15 @@ _sqlite3.Connection.serialize as serialize
22212221
22222222
Serialize a database into a byte string.
22232223
2224-
For an ordinary on-disk database file, the serialization is just a copy of the
2225-
disk file. For an in-memory database or a "temp" database, the serialization is
2226-
the same sequence of bytes which would be written to disk if that database
2227-
were backed up to disk.
2224+
For an ordinary on-disk database file, the serialization is just
2225+
a copy of the disk file. For an in-memory database or a "temp"
2226+
database, the serialization is the same sequence of bytes which
2227+
would be written to disk if that database were backed up to disk.
22282228
[clinic start generated code]*/
22292229

22302230
static PyObject *
22312231
serialize_impl(pysqlite_Connection *self, const char *name)
2232-
/*[clinic end generated code: output=97342b0e55239dd3 input=963e617cdf75c747]*/
2232+
/*[clinic end generated code: output=97342b0e55239dd3 input=7e48654e8e082fa8]*/
22332233
{
22342234
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
22352235
return NULL;
@@ -2263,7 +2263,6 @@ serialize_impl(pysqlite_Connection *self, const char *name)
22632263
}
22642264

22652265
/*[clinic input]
2266-
@permit_long_docstring_body
22672266
_sqlite3.Connection.deserialize as deserialize
22682267
22692268
data: Py_buffer(accept={buffer, str})
@@ -2275,18 +2274,19 @@ _sqlite3.Connection.deserialize as deserialize
22752274
22762275
Load a serialized database.
22772276
2278-
The deserialize interface causes the database connection to disconnect from the
2279-
target database, and then reopen it as an in-memory database based on the given
2280-
serialized data.
2277+
The deserialize interface causes the database connection to
2278+
disconnect from the target database, and then reopen it as
2279+
an in-memory database based on the given serialized data.
22812280
2282-
The deserialize interface will fail with SQLITE_BUSY if the database is
2283-
currently in a read transaction or is involved in a backup operation.
2281+
The deserialize interface will fail with SQLITE_BUSY if the database
2282+
is currently in a read transaction or is involved in a backup
2283+
operation.
22842284
[clinic start generated code]*/
22852285

22862286
static PyObject *
22872287
deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
22882288
const char *name)
2289-
/*[clinic end generated code: output=e394c798b98bad89 input=037e94599aaa5b5c]*/
2289+
/*[clinic end generated code: output=e394c798b98bad89 input=5d20e028d98c0686]*/
22902290
{
22912291
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
22922292
return NULL;
@@ -2359,13 +2359,14 @@ _sqlite3.Connection.__exit__ as pysqlite_connection_exit
23592359
23602360
Called when the connection is used as a context manager.
23612361
2362-
If there was any exception, a rollback takes place; otherwise we commit.
2362+
If there was any exception, a rollback takes place; otherwise we
2363+
commit.
23632364
[clinic start generated code]*/
23642365

23652366
static PyObject *
23662367
pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
23672368
PyObject *exc_value, PyObject *exc_tb)
2368-
/*[clinic end generated code: output=0705200e9321202a input=bd66f1532c9c54a7]*/
2369+
/*[clinic end generated code: output=0705200e9321202a input=8fdb0392ee6f3466]*/
23692370
{
23702371
int commit = 0;
23712372
PyObject* result;
@@ -2400,26 +2401,25 @@ pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
24002401
}
24012402

24022403
/*[clinic input]
2403-
@permit_long_docstring_body
24042404
_sqlite3.Connection.setlimit as setlimit
24052405
24062406
category: int
24072407
The limit category to be set.
24082408
limit: int
2409-
The new limit. If the new limit is a negative number, the limit is
2410-
unchanged.
2409+
The new limit. If the new limit is a negative number, the limit
2410+
is unchanged.
24112411
/
24122412
24132413
Set connection run-time limits.
24142414
2415-
Attempts to increase a limit above its hard upper bound are silently truncated
2416-
to the hard upper bound. Regardless of whether or not the limit was changed,
2417-
the prior value of the limit is returned.
2415+
Attempts to increase a limit above its hard upper bound are silently
2416+
truncated to the hard upper bound. Regardless of whether or not the
2417+
limit was changed, the prior value of the limit is returned.
24182418
[clinic start generated code]*/
24192419

24202420
static PyObject *
24212421
setlimit_impl(pysqlite_Connection *self, int category, int limit)
2422-
/*[clinic end generated code: output=0d208213f8d68ccd input=bf06e06a21eb37e2]*/
2422+
/*[clinic end generated code: output=0d208213f8d68ccd input=5c2e430091206677]*/
24232423
{
24242424
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
24252425
return NULL;

0 commit comments

Comments
 (0)