@@ -662,7 +662,7 @@ static PyObject *Str_repr(Str *self) {
662
662
663
663
static Py_hash_t Str_hash (Str * self ) { return (Py_hash_t )sz_hash (self -> memory .start , self -> memory .length ); }
664
664
665
- static char const * const doc_like_hash = //
665
+ static char const doc_like_hash [] = //
666
666
"Compute the hash value of the string.\n\n"
667
667
"This function can be called as a method on a Str object or as a standalone function.\n\n"
668
668
"Args:\n"
@@ -1204,7 +1204,7 @@ static PyObject *Strs_richcompare(PyObject *self, PyObject *other, int op) {
1204
1204
}
1205
1205
}
1206
1206
1207
- static char const * const doc_decode = //
1207
+ static char const doc_decode [] = //
1208
1208
"Decode the bytes into a Unicode string with a given encoding.\n\n"
1209
1209
"Args:\n"
1210
1210
" self (Str or str or bytes): The string object.\n"
@@ -1257,7 +1257,7 @@ static PyObject *Str_decode(PyObject *self, PyObject *args, PyObject *kwargs) {
1257
1257
return PyUnicode_Decode (text .start , text .length , encoding .start , errors .start );
1258
1258
}
1259
1259
1260
- static char const * const doc_write_to = //
1260
+ static char const doc_write_to [] = //
1261
1261
"Write the string to a file.\n\n"
1262
1262
"Args:\n"
1263
1263
" self (Str or str or bytes): The string object.\n"
@@ -1335,7 +1335,7 @@ static PyObject *Str_write_to(PyObject *self, PyObject *args, PyObject *kwargs)
1335
1335
Py_RETURN_NONE ;
1336
1336
}
1337
1337
1338
- static char const * const doc_offset_within = //
1338
+ static char const doc_offset_within [] = //
1339
1339
"Return the raw byte offset of this StringZilla string within a larger StringZilla string.\n\n"
1340
1340
"Args:\n"
1341
1341
" self (Str or str or bytes): The substring.\n"
@@ -1468,7 +1468,7 @@ static int _Str_find_implementation_( //
1468
1468
return 1 ;
1469
1469
}
1470
1470
1471
- static char const * const doc_contains = //
1471
+ static char const doc_contains [] = //
1472
1472
"Check if a string contains a substring.\n\n"
1473
1473
"Args:\n"
1474
1474
" self (Str or str or bytes): The string object.\n"
@@ -1488,7 +1488,7 @@ static PyObject *Str_contains(PyObject *self, PyObject *args, PyObject *kwargs)
1488
1488
else { Py_RETURN_TRUE ; }
1489
1489
}
1490
1490
1491
- static char const * const doc_find = //
1491
+ static char const doc_find [] = //
1492
1492
"Find the first occurrence of a substring.\n\n"
1493
1493
"Args:\n"
1494
1494
" self (Str or str or bytes): The string object.\n"
@@ -1507,7 +1507,7 @@ static PyObject *Str_find(PyObject *self, PyObject *args, PyObject *kwargs) {
1507
1507
return PyLong_FromSsize_t (signed_offset );
1508
1508
}
1509
1509
1510
- static char const * const doc_index = //
1510
+ static char const doc_index [] = //
1511
1511
"Find the first occurrence of a substring or raise an error if not found.\n\n"
1512
1512
"Args:\n"
1513
1513
" self (Str or str or bytes): The string object.\n"
@@ -1532,7 +1532,7 @@ static PyObject *Str_index(PyObject *self, PyObject *args, PyObject *kwargs) {
1532
1532
return PyLong_FromSsize_t (signed_offset );
1533
1533
}
1534
1534
1535
- static char const * const doc_rfind = //
1535
+ static char const doc_rfind [] = //
1536
1536
"Find the last occurrence of a substring.\n\n"
1537
1537
"Args:\n"
1538
1538
" self (Str or str or bytes): The string object.\n"
@@ -1551,7 +1551,7 @@ static PyObject *Str_rfind(PyObject *self, PyObject *args, PyObject *kwargs) {
1551
1551
return PyLong_FromSsize_t (signed_offset );
1552
1552
}
1553
1553
1554
- static char const * const doc_rindex = //
1554
+ static char const doc_rindex [] = //
1555
1555
"Find the last occurrence of a substring or raise an error if not found.\n\n"
1556
1556
"Args:\n"
1557
1557
" self (Str or str or bytes): The string object.\n"
@@ -1631,7 +1631,7 @@ static PyObject *_Str_partition_implementation(PyObject *self, PyObject *args, P
1631
1631
return result_tuple ;
1632
1632
}
1633
1633
1634
- static char const * const doc_partition = //
1634
+ static char const doc_partition [] = //
1635
1635
"Split the string into a 3-tuple around the first occurrence of a separator.\n\n"
1636
1636
"Args:\n"
1637
1637
" self (Str or str or bytes): The string object.\n"
@@ -1643,7 +1643,7 @@ static PyObject *Str_partition(PyObject *self, PyObject *args, PyObject *kwargs)
1643
1643
return _Str_partition_implementation (self , args , kwargs , & sz_find , sz_false_k );
1644
1644
}
1645
1645
1646
- static char const * const doc_rpartition = //
1646
+ static char const doc_rpartition [] = //
1647
1647
"Split the string into a 3-tuple around the last occurrence of a separator.\n\n"
1648
1648
"Args:\n"
1649
1649
" self (Str or str or bytes): The string object.\n"
@@ -1655,7 +1655,7 @@ static PyObject *Str_rpartition(PyObject *self, PyObject *args, PyObject *kwargs
1655
1655
return _Str_partition_implementation (self , args , kwargs , & sz_rfind , sz_true_k );
1656
1656
}
1657
1657
1658
- static char const * const doc_count = //
1658
+ static char const doc_count [] = //
1659
1659
"Count the occurrences of a substring.\n\n"
1660
1660
"Args:\n"
1661
1661
" self (Str or str or bytes): The string object.\n"
@@ -1790,7 +1790,7 @@ static PyObject *_Str_edit_distance(PyObject *self, PyObject *args, PyObject *kw
1790
1790
return PyLong_FromSize_t (distance );
1791
1791
}
1792
1792
1793
- static char const * const doc_edit_distance = //
1793
+ static char const doc_edit_distance [] = //
1794
1794
"Compute the Levenshtein edit distance between two strings.\n\n"
1795
1795
"Args:\n"
1796
1796
" self (Str or str or bytes): The first string.\n"
@@ -1803,7 +1803,7 @@ static PyObject *Str_edit_distance(PyObject *self, PyObject *args, PyObject *kwa
1803
1803
return _Str_edit_distance (self , args , kwargs , & sz_edit_distance );
1804
1804
}
1805
1805
1806
- static char const * const doc_edit_distance_unicode = //
1806
+ static char const doc_edit_distance_unicode [] = //
1807
1807
"Compute the Levenshtein edit distance between two Unicode strings.\n\n"
1808
1808
"Args:\n"
1809
1809
" self (Str or str or bytes): The first string.\n"
@@ -1866,7 +1866,7 @@ static PyObject *_Str_hamming_distance(PyObject *self, PyObject *args, PyObject
1866
1866
return PyLong_FromSize_t (distance );
1867
1867
}
1868
1868
1869
- static char const * const doc_hamming_distance = //
1869
+ static char const doc_hamming_distance [] = //
1870
1870
"Compute the Hamming distance between two strings.\n\n"
1871
1871
"Args:\n"
1872
1872
" self (Str or str or bytes): The first string.\n"
@@ -1879,7 +1879,7 @@ static PyObject *Str_hamming_distance(PyObject *self, PyObject *args, PyObject *
1879
1879
return _Str_hamming_distance (self , args , kwargs , & sz_hamming_distance );
1880
1880
}
1881
1881
1882
- static char const * const doc_hamming_distance_unicode = //
1882
+ static char const doc_hamming_distance_unicode [] = //
1883
1883
"Compute the Hamming distance between two Unicode strings.\n\n"
1884
1884
"Args:\n"
1885
1885
" self (Str or str or bytes): The first string.\n"
@@ -1892,7 +1892,7 @@ static PyObject *Str_hamming_distance_unicode(PyObject *self, PyObject *args, Py
1892
1892
return _Str_hamming_distance (self , args , kwargs , & sz_hamming_distance_utf8 );
1893
1893
}
1894
1894
1895
- static char const * const doc_alignment_score = //
1895
+ static char const doc_alignment_score [] = //
1896
1896
"Compute the Needleman-Wunsch alignment score between two strings.\n\n"
1897
1897
"Args:\n"
1898
1898
" self (Str or str or bytes): The first string.\n"
@@ -1999,7 +1999,7 @@ static PyObject *Str_alignment_score(PyObject *self, PyObject *args, PyObject *k
1999
1999
return PyLong_FromSsize_t (score );
2000
2000
}
2001
2001
2002
- static char const * const doc_startswith = //
2002
+ static char const doc_startswith [] = //
2003
2003
"Check if a string starts with a given prefix.\n\n"
2004
2004
"Args:\n"
2005
2005
" self (Str or str or bytes): The string object.\n"
@@ -2052,7 +2052,7 @@ static PyObject *Str_startswith(PyObject *self, PyObject *args, PyObject *kwargs
2052
2052
else { Py_RETURN_FALSE ; }
2053
2053
}
2054
2054
2055
- static char const * const doc_endswith = //
2055
+ static char const doc_endswith [] = //
2056
2056
"Check if a string ends with a given suffix.\n\n"
2057
2057
"Args:\n"
2058
2058
" self (Str or str or bytes): The string object.\n"
@@ -2105,7 +2105,7 @@ static PyObject *Str_endswith(PyObject *self, PyObject *args, PyObject *kwargs)
2105
2105
else { Py_RETURN_FALSE ; }
2106
2106
}
2107
2107
2108
- static char const * const doc_translate = //
2108
+ static char const doc_translate [] = //
2109
2109
"Perform transformation of a string using a look-up table.\n\n"
2110
2110
"Args:\n"
2111
2111
" self (Str or str or bytes): The string object.\n"
@@ -2234,7 +2234,7 @@ static PyObject *Str_translate(PyObject *self, PyObject *args, PyObject *kwargs)
2234
2234
}
2235
2235
}
2236
2236
2237
- static char const * const doc_find_first_of = //
2237
+ static char const doc_find_first_of [] = //
2238
2238
"Find the index of the first occurrence of any character from another string.\n\n"
2239
2239
"Args:\n"
2240
2240
" self (Str or str or bytes): The string object.\n"
@@ -2254,7 +2254,7 @@ static PyObject *Str_find_first_of(PyObject *self, PyObject *args, PyObject *kwa
2254
2254
return PyLong_FromSsize_t (signed_offset );
2255
2255
}
2256
2256
2257
- static char const * const doc_find_first_not_of = //
2257
+ static char const doc_find_first_not_of [] = //
2258
2258
"Find the index of the first character not in another string.\n\n"
2259
2259
"Args:\n"
2260
2260
" self (Str or str or bytes): The string object.\n"
@@ -2274,7 +2274,7 @@ static PyObject *Str_find_first_not_of(PyObject *self, PyObject *args, PyObject
2274
2274
return PyLong_FromSsize_t (signed_offset );
2275
2275
}
2276
2276
2277
- static char const * const doc_find_last_of = //
2277
+ static char const doc_find_last_of [] = //
2278
2278
"Find the index of the last occurrence of any character from another string.\n\n"
2279
2279
"Args:\n"
2280
2280
" self (Str or str or bytes): The string object.\n"
@@ -2294,7 +2294,7 @@ static PyObject *Str_find_last_of(PyObject *self, PyObject *args, PyObject *kwar
2294
2294
return PyLong_FromSsize_t (signed_offset );
2295
2295
}
2296
2296
2297
- static char const * const doc_find_last_not_of = //
2297
+ static char const doc_find_last_not_of [] = //
2298
2298
"Find the index of the last character not in another string.\n\n"
2299
2299
"Args:\n"
2300
2300
" self (Str or str or bytes): The string object.\n"
@@ -2602,7 +2602,7 @@ static PyObject *Str_split_with_known_callback(PyObject *self, PyObject *args, P
2602
2602
: Str_rsplit_ (text_object , text , separator , keepseparator , maxsplit , finder , match_length );
2603
2603
}
2604
2604
2605
- static char const * const doc_split = //
2605
+ static char const doc_split [] = //
2606
2606
"Split a string by a separator.\n\n"
2607
2607
"Args:\n"
2608
2608
" self (Str or str or bytes): The string object.\n"
@@ -2618,7 +2618,7 @@ static PyObject *Str_split(PyObject *self, PyObject *args, PyObject *kwargs) {
2618
2618
return Str_split_with_known_callback (self , args , kwargs , & sz_find , 0 , sz_false_k , sz_false_k );
2619
2619
}
2620
2620
2621
- static char const * const doc_rsplit = //
2621
+ static char const doc_rsplit [] = //
2622
2622
"Split a string by a separator starting from the end.\n\n"
2623
2623
"Args:\n"
2624
2624
" self (Str or str or bytes): The string object.\n"
@@ -2634,7 +2634,7 @@ static PyObject *Str_rsplit(PyObject *self, PyObject *args, PyObject *kwargs) {
2634
2634
return Str_split_with_known_callback (self , args , kwargs , & sz_rfind , 0 , sz_true_k , sz_false_k );
2635
2635
}
2636
2636
2637
- static char const * const doc_split_charset = //
2637
+ static char const doc_split_charset [] = //
2638
2638
"Split a string by a set of character separators.\n\n"
2639
2639
"Args:\n"
2640
2640
" self (Str or str or bytes): The string object.\n"
@@ -2648,7 +2648,7 @@ static PyObject *Str_split_charset(PyObject *self, PyObject *args, PyObject *kwa
2648
2648
return Str_split_with_known_callback (self , args , kwargs , & sz_find_char_from , 1 , sz_false_k , sz_false_k );
2649
2649
}
2650
2650
2651
- static char const * const doc_rsplit_charset = //
2651
+ static char const doc_rsplit_charset [] = //
2652
2652
"Split a string by a set of character separators in reverse order.\n\n"
2653
2653
"Args:\n"
2654
2654
" self (Str or str or bytes): The string object.\n"
@@ -2662,7 +2662,7 @@ static PyObject *Str_rsplit_charset(PyObject *self, PyObject *args, PyObject *kw
2662
2662
return Str_split_with_known_callback (self , args , kwargs , & sz_rfind_char_from , 1 , sz_true_k , sz_false_k );
2663
2663
}
2664
2664
2665
- static char const * const doc_split_iter = //
2665
+ static char const doc_split_iter [] = //
2666
2666
"Create an iterator for splitting a string by a separator.\n\n"
2667
2667
"Args:\n"
2668
2668
" self (Str or str or bytes): The string object.\n"
@@ -2677,7 +2677,7 @@ static PyObject *Str_split_iter(PyObject *self, PyObject *args, PyObject *kwargs
2677
2677
return Str_split_with_known_callback (self , args , kwargs , & sz_find , 0 , sz_false_k , sz_true_k );
2678
2678
}
2679
2679
2680
- static char const * const doc_rsplit_iter = //
2680
+ static char const doc_rsplit_iter [] = //
2681
2681
"Create an iterator for splitting a string by a separator in reverse order.\n\n"
2682
2682
"Args:\n"
2683
2683
" self (Str or str or bytes): The string object.\n"
@@ -2692,7 +2692,7 @@ static PyObject *Str_rsplit_iter(PyObject *self, PyObject *args, PyObject *kwarg
2692
2692
return Str_split_with_known_callback (self , args , kwargs , & sz_rfind , 0 , sz_true_k , sz_true_k );
2693
2693
}
2694
2694
2695
- static char const * const doc_split_charset_iter = //
2695
+ static char const doc_split_charset_iter [] = //
2696
2696
"Create an iterator for splitting a string by a set of character separators.\n\n"
2697
2697
"Args:\n"
2698
2698
" self (Str or str or bytes): The string object.\n"
@@ -2705,7 +2705,7 @@ static PyObject *Str_split_charset_iter(PyObject *self, PyObject *args, PyObject
2705
2705
return Str_split_with_known_callback (self , args , kwargs , & sz_find_char_from , 1 , sz_false_k , sz_true_k );
2706
2706
}
2707
2707
2708
- static char const * const doc_rsplit_charset_iter = //
2708
+ static char const doc_rsplit_charset_iter [] = //
2709
2709
"Create an iterator for splitting a string by a set of character separators in reverse order.\n\n"
2710
2710
"Args:\n"
2711
2711
" self (Str or str or bytes): The string object.\n"
@@ -2718,7 +2718,7 @@ static PyObject *Str_rsplit_charset_iter(PyObject *self, PyObject *args, PyObjec
2718
2718
return Str_split_with_known_callback (self , args , kwargs , & sz_rfind_char_from , 1 , sz_true_k , sz_true_k );
2719
2719
}
2720
2720
2721
- static char const * const doc_splitlines = //
2721
+ static char const doc_splitlines [] = //
2722
2722
"Split a string by line breaks.\n\n"
2723
2723
"Args:\n"
2724
2724
" self (Str or str or bytes): The string object.\n"
0 commit comments