| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1620,6 +1620,7 @@ bytearray_take_bytes_impl(PyByteArrayObject *self, PyObject *n) | |||
| 1620 | 1620 | ||
| 1621 | 1621 | ||
| 1622 | 1622 | /*[clinic input] | |
| 1623 | + @permit_long_summary | ||
| 1623 | 1624 | @critical_section | |
| 1624 | 1625 | bytearray.translate | |
| 1625 | 1626 | ||
@@ -1630,14 +1631,15 @@ bytearray.translate | |||
| 1630 | 1631 | ||
| 1631 | 1632 | Return a copy with each character mapped by the given translation table. | |
| 1632 | 1633 | ||
| 1633 | - All characters occurring in the optional argument delete are removed. | ||
| 1634 | - The remaining characters are mapped through the given translation table. | ||
| 1634 | + All characters occurring in the optional argument delete are | ||
| 1635 | + removed. The remaining characters are mapped through the given | ||
| 1636 | + translation table. | ||
| 1635 | 1637 | [clinic start generated code]*/ | |
| 1636 | 1638 | ||
| 1637 | 1639 | static PyObject * | |
| 1638 | 1640 | bytearray_translate_impl(PyByteArrayObject *self, PyObject *table, | |
| 1639 | 1641 | PyObject *deletechars) | |
| 1640 | - /*[clinic end generated code: output=b6a8f01c2a74e446 input=cd6fa93ca04e05bc]*/ | ||
| 1642 | + /*[clinic end generated code: output=b6a8f01c2a74e446 input=e30d2ae004365ed9]*/ | ||
| 1641 | 1643 | { | |
| 1642 | 1644 | char *input, *output; | |
| 1643 | 1645 | const char *table_chars; | |
@@ -1727,7 +1729,6 @@ bytearray_translate_impl(PyByteArrayObject *self, PyObject *table, | |||
| 1727 | 1729 | /*[clinic input] | |
| 1728 | 1730 | ||
| 1729 | 1731 | @permit_long_summary | |
| 1730 | - @permit_long_docstring_body | ||
| 1731 | 1732 | @staticmethod | |
| 1732 | 1733 | bytearray.maketrans | |
| 1733 | 1734 | ||
@@ -1737,15 +1738,15 @@ bytearray.maketrans | |||
| 1737 | 1738 | ||
| 1738 | 1739 | Return a translation table usable for the bytes or bytearray translate method. | |
| 1739 | 1740 | ||
| 1740 | - The returned table will be one where each byte in frm is mapped to the byte at | ||
| 1741 | - the same position in to. | ||
| 1741 | + The returned table will be one where each byte in frm is mapped to | ||
| 1742 | + the byte at the same position in to. | ||
| 1742 | 1743 | ||
| 1743 | 1744 | The bytes objects frm and to must be of the same length. | |
| 1744 | 1745 | [clinic start generated code]*/ | |
| 1745 | 1746 | ||
| 1746 | 1747 | static PyObject * | |
| 1747 | 1748 | bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to) | |
| 1748 | - /*[clinic end generated code: output=1df267d99f56b15e input=1146b43a592eca13]*/ | ||
| 1749 | + /*[clinic end generated code: output=1df267d99f56b15e input=c2f5f6e7e6b0221d]*/ | ||
| 1749 | 1750 | { | |
| 1750 | 1751 | return _Py_bytes_maketrans(frm, to); | |
| 1751 | 1752 | } | |
@@ -1785,8 +1786,8 @@ bytearray.split | |||
| 1785 | 1786 | ||
| 1786 | 1787 | sep: object = None | |
| 1787 | 1788 | The delimiter according which to split the bytearray. | |
| 1788 | - None (the default value) means split on ASCII whitespace characters | ||
| 1789 | - (space, tab, return, newline, formfeed, vertical tab). | ||
| 1789 | + None (the default value) means split on ASCII whitespace | ||
| 1790 | + characters (space, tab, return, newline, formfeed, vertical tab). | ||
| 1790 | 1791 | maxsplit: Py_ssize_t = -1 | |
| 1791 | 1792 | Maximum number of splits to do. | |
| 1792 | 1793 | -1 (the default value) means no limit. | |
@@ -1797,7 +1798,7 @@ Return a list of the sections in the bytearray, using sep as the delimiter. | |||
| 1797 | 1798 | static PyObject * | |
| 1798 | 1799 | bytearray_split_impl(PyByteArrayObject *self, PyObject *sep, | |
| 1799 | 1800 | Py_ssize_t maxsplit) | |
| 1800 | - /*[clinic end generated code: output=833e2cf385d9a04d input=dd9f6e2910cc3a34]*/ | ||
| 1801 | + /*[clinic end generated code: output=833e2cf385d9a04d input=45605178023b52ac]*/ | ||
| 1801 | 1802 | { | |
| 1802 | 1803 | PyObject *list = NULL; | |
| 1803 | 1804 | ||
@@ -1829,7 +1830,6 @@ bytearray_split_impl(PyByteArrayObject *self, PyObject *sep, | |||
| 1829 | 1830 | } | |
| 1830 | 1831 | ||
| 1831 | 1832 | /*[clinic input] | |
| 1832 | - @permit_long_docstring_body | ||
| 1833 | 1833 | @critical_section | |
| 1834 | 1834 | bytearray.partition | |
| 1835 | 1835 | ||
@@ -1838,17 +1838,18 @@ bytearray.partition | |||
| 1838 | 1838 | ||
| 1839 | 1839 | Partition the bytearray into three parts using the given separator. | |
| 1840 | 1840 | ||
| 1841 | - This will search for the separator sep in the bytearray. If the separator is | ||
| 1842 | - found, returns a 3-tuple containing the part before the separator, the | ||
| 1843 | - separator itself, and the part after it as new bytearray objects. | ||
| 1841 | + This will search for the separator sep in the bytearray. If the | ||
| 1842 | + separator is found, returns a 3-tuple containing the part before the | ||
| 1843 | + separator, the separator itself, and the part after it as new | ||
| 1844 | + bytearray objects. | ||
| 1844 | 1845 | ||
| 1845 | - If the separator is not found, returns a 3-tuple containing the copy of the | ||
| 1846 | - original bytearray object and two empty bytearray objects. | ||
| 1846 | + If the separator is not found, returns a 3-tuple containing the copy | ||
| 1847 | + of the original bytearray object and two empty bytearray objects. | ||
| 1847 | 1848 | [clinic start generated code]*/ | |
| 1848 | 1849 | ||
| 1849 | 1850 | static PyObject * | |
| 1850 | 1851 | bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep) | |
| 1851 | - /*[clinic end generated code: output=b5fa1e03f10cfccb input=b87276af883f39d9]*/ | ||
| 1852 | + /*[clinic end generated code: output=b5fa1e03f10cfccb input=d76673ed03acf5dd]*/ | ||
| 1852 | 1853 | { | |
| 1853 | 1854 | PyObject *bytesep, *result; | |
| 1854 | 1855 | ||
@@ -1868,7 +1869,6 @@ bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep) | |||
| 1868 | 1869 | } | |
| 1869 | 1870 | ||
| 1870 | 1871 | /*[clinic input] | |
| 1871 | - @permit_long_docstring_body | ||
| 1872 | 1872 | @critical_section | |
| 1873 | 1873 | bytearray.rpartition | |
| 1874 | 1874 | ||
@@ -1877,18 +1877,19 @@ bytearray.rpartition | |||
| 1877 | 1877 | ||
| 1878 | 1878 | Partition the bytearray into three parts using the given separator. | |
| 1879 | 1879 | ||
| 1880 | - This will search for the separator sep in the bytearray, starting at the end. | ||
| 1881 | - If the separator is found, returns a 3-tuple containing the part before the | ||
| 1882 | - separator, the separator itself, and the part after it as new bytearray | ||
| 1883 | - objects. | ||
| 1880 | + This will search for the separator sep in the bytearray, starting at | ||
| 1881 | + the end. If the separator is found, returns a 3-tuple containing | ||
| 1882 | + the part before the separator, the separator itself, and the part | ||
| 1883 | + after it as new bytearray objects. | ||
| 1884 | 1884 | ||
| 1885 | - If the separator is not found, returns a 3-tuple containing two empty bytearray | ||
| 1886 | - objects and the copy of the original bytearray object. | ||
| 1885 | + If the separator is not found, returns a 3-tuple containing two | ||
| 1886 | + empty bytearray objects and the copy of the original bytearray | ||
| 1887 | + object. | ||
| 1887 | 1888 | [clinic start generated code]*/ | |
| 1888 | 1889 | ||
| 1889 | 1890 | static PyObject * | |
| 1890 | 1891 | bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep) | |
| 1891 | - /*[clinic end generated code: output=0186ce7b1ef61289 input=5bdcfc4c333bcfab]*/ | ||
| 1892 | + /*[clinic end generated code: output=0186ce7b1ef61289 input=b9216a2074174a36]*/ | ||
| 1892 | 1893 | { | |
| 1893 | 1894 | PyObject *bytesep, *result; | |
| 1894 | 1895 | ||
@@ -1909,19 +1910,19 @@ bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep) | |||
| 1909 | 1910 | ||
| 1910 | 1911 | /*[clinic input] | |
| 1911 | 1912 | @permit_long_summary | |
| 1912 | - @permit_long_docstring_body | ||
| 1913 | 1913 | @critical_section | |
| 1914 | 1914 | bytearray.rsplit = bytearray.split | |
| 1915 | 1915 | ||
| 1916 | 1916 | Return a list of the sections in the bytearray, using sep as the delimiter. | |
| 1917 | 1917 | ||
| 1918 | - Splitting is done starting at the end of the bytearray and working to the front. | ||
| 1918 | + Splitting is done starting at the end of the bytearray and working | ||
| 1919 | + to the front. | ||
| 1919 | 1920 | [clinic start generated code]*/ | |
| 1920 | 1921 | ||
| 1921 | 1922 | static PyObject * | |
| 1922 | 1923 | bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep, | |
| 1923 | 1924 | Py_ssize_t maxsplit) | |
| 1924 | - /*[clinic end generated code: output=a55e0b5a03cb6190 input=60e9abf305128ff4]*/ | ||
| 1925 | + /*[clinic end generated code: output=a55e0b5a03cb6190 input=e201671c9a0c19ee]*/ | ||
| 1925 | 1926 | { | |
| 1926 | 1927 | PyObject *list = NULL; | |
| 1927 | 1928 | ||
@@ -2392,7 +2393,6 @@ bytearray_strip_impl_helper(PyByteArrayObject* self, PyObject* bytes, int stript | |||
| 2392 | 2393 | } | |
| 2393 | 2394 | ||
| 2394 | 2395 | /*[clinic input] | |
| 2395 | - @permit_long_docstring_body | ||
| 2396 | 2396 | @critical_section | |
| 2397 | 2397 | bytearray.strip | |
| 2398 | 2398 | ||
@@ -2401,12 +2401,13 @@ bytearray.strip | |||
| 2401 | 2401 | ||
| 2402 | 2402 | Strip leading and trailing bytes contained in the argument. | |
| 2403 | 2403 | ||
| 2404 | - If the argument is omitted or None, strip leading and trailing ASCII whitespace. | ||
| 2404 | + If the argument is omitted or None, strip leading and trailing ASCII | ||
| 2405 | + whitespace. | ||
| 2405 | 2406 | [clinic start generated code]*/ | |
| 2406 | 2407 | ||
| 2407 | 2408 | static PyObject * | |
| 2408 | 2409 | bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes) | |
| 2409 | - /*[clinic end generated code: output=760412661a34ad5a input=6acaf88b2ec9daa7]*/ | ||
| 2410 | + /*[clinic end generated code: output=760412661a34ad5a input=f4ec5fa609df7d14]*/ | ||
| 2410 | 2411 | { | |
| 2411 | 2412 | return bytearray_strip_impl_helper(self, bytes, BOTHSTRIP); | |
| 2412 | 2413 | } | |
@@ -2506,19 +2507,19 @@ bytearray.decode | |||
| 2506 | 2507 | encoding: str(c_default="NULL") = 'utf-8' | |
| 2507 | 2508 | The encoding with which to decode the bytearray. | |
| 2508 | 2509 | errors: str(c_default="NULL") = 'strict' | |
| 2509 | - The error handling scheme to use for the handling of decoding errors. | ||
| 2510 | - The default is 'strict' meaning that decoding errors raise a | ||
| 2511 | - UnicodeDecodeError. Other possible values are 'ignore' and 'replace' | ||
| 2512 | - as well as any other name registered with codecs.register_error that | ||
| 2513 | - can handle UnicodeDecodeErrors. | ||
| 2510 | + The error handling scheme to use for the handling of decoding | ||
| 2511 | + errors. The default is 'strict' meaning that decoding errors | ||
| 2512 | + raise a UnicodeDecodeError. Other possible values are 'ignore' | ||
| 2513 | + and 'replace' as well as any other name registered with | ||
| 2514 | + codecs.register_error that can handle UnicodeDecodeErrors. | ||
| 2514 | 2515 | ||
| 2515 | 2516 | Decode the bytearray using the codec registered for encoding. | |
| 2516 | 2517 | [clinic start generated code]*/ | |
| 2517 | 2518 | ||
| 2518 | 2519 | static PyObject * | |
| 2519 | 2520 | bytearray_decode_impl(PyByteArrayObject *self, const char *encoding, | |
| 2520 | 2521 | const char *errors) | |
| 2521 | - /*[clinic end generated code: output=f57d43f4a00b42c5 input=86c303ee376b8453]*/ | ||
| 2522 | + /*[clinic end generated code: output=f57d43f4a00b42c5 input=e51ce9b82b51e2ca]*/ | ||
| 2522 | 2523 | { | |
| 2523 | 2524 | if (encoding == NULL) | |
| 2524 | 2525 | encoding = PyUnicode_GetDefaultEncoding(); | |
@@ -2550,14 +2551,15 @@ bytearray.join | |||
| 2550 | 2551 | ||
| 2551 | 2552 | Concatenate any number of bytes/bytearray objects. | |
| 2552 | 2553 | ||
| 2553 | - The bytearray whose method is called is inserted in between each pair. | ||
| 2554 | + The bytearray whose method is called is inserted in between each | ||
| 2555 | + pair. | ||
| 2554 | 2556 | ||
| 2555 | 2557 | The result is returned as a new bytearray object. | |
| 2556 | 2558 | [clinic start generated code]*/ | |
| 2557 | 2559 | ||
| 2558 | 2560 | static PyObject * | |
| 2559 | 2561 | bytearray_join_impl(PyByteArrayObject *self, PyObject *iterable_of_bytes) | |
| 2560 | - /*[clinic end generated code: output=0ced382b5846a7ee input=49627e07ca31ca26]*/ | ||
| 2562 | + /*[clinic end generated code: output=0ced382b5846a7ee input=0a31db349efcd7fa]*/ | ||
| 2561 | 2563 | { | |
| 2562 | 2564 | PyObject *ret; | |
| 2563 | 2565 | self->ob_exports++; // this protects `self` from being cleared/resized if `iterable_of_bytes` is a custom iterator | |
@@ -2588,21 +2590,20 @@ bytearray_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) | |||
| 2588 | 2590 | ||
| 2589 | 2591 | /*[clinic input] | |
| 2590 | 2592 | @permit_long_summary | |
| 2591 | - @permit_long_docstring_body | ||
| 2592 | 2593 | @critical_section | |
| 2593 | 2594 | bytearray.splitlines | |
| 2594 | 2595 | ||
| 2595 | 2596 | keepends: bool = False | |
| 2596 | 2597 | ||
| 2597 | 2598 | Return a list of the lines in the bytearray, breaking at line boundaries. | |
| 2598 | 2599 | ||
| 2599 | - Line breaks are not included in the resulting list unless keepends is given and | ||
| 2600 | - true. | ||
| 2600 | + Line breaks are not included in the resulting list unless keepends | ||
| 2601 | + is given and true. | ||
| 2601 | 2602 | [clinic start generated code]*/ | |
| 2602 | 2603 | ||
| 2603 | 2604 | static PyObject * | |
| 2604 | 2605 | bytearray_splitlines_impl(PyByteArrayObject *self, int keepends) | |
| 2605 | - /*[clinic end generated code: output=4223c94b895f6ad9 input=21bc3f02bf1be832]*/ | ||
| 2606 | + /*[clinic end generated code: output=4223c94b895f6ad9 input=cc2bb740eed19f27]*/ | ||
| 2606 | 2607 | { | |
| 2607 | 2608 | return stringlib_splitlines( | |
| 2608 | 2609 | (PyObject*) self, PyByteArray_AS_STRING(self), | |
@@ -2620,12 +2621,13 @@ bytearray.fromhex | |||
| 2620 | 2621 | Create a bytearray object from a string of hexadecimal numbers. | |
| 2621 | 2622 | ||
| 2622 | 2623 | Spaces between two numbers are accepted. | |
| 2623 | - Example: bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef') | ||
| 2624 | + Example: | ||
| 2625 | + bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef') | ||
| 2624 | 2626 | [clinic start generated code]*/ | |
| 2625 | 2627 | ||
| 2626 | 2628 | static PyObject * | |
| 2627 | 2629 | bytearray_fromhex_impl(PyTypeObject *type, PyObject *string) | |
| 2628 | - /*[clinic end generated code: output=8f0f0b6d30fb3ba0 input=7e314e5b2d7ab484]*/ | ||
| 2630 | + /*[clinic end generated code: output=8f0f0b6d30fb3ba0 input=2243a8b0b9e66cd5]*/ | ||
| 2629 | 2631 | { | |
| 2630 | 2632 | PyObject *result = _PyBytes_FromHex(string, type == &PyByteArray_Type); | |
| 2631 | 2633 | if (type != &PyByteArray_Type && result != NULL) { | |
@@ -2641,8 +2643,8 @@ bytearray.hex | |||
| 2641 | 2643 | sep: object = NULL | |
| 2642 | 2644 | An optional single character or byte to separate hex bytes. | |
| 2643 | 2645 | bytes_per_sep: Py_ssize_t = 1 | |
| 2644 | - How many bytes between separators. Positive values count from the | ||
| 2645 | - right, negative values count from the left. | ||
| 2646 | + How many bytes between separators. Positive values count from | ||
| 2647 | + the right, negative values count from the left. | ||
| 2646 | 2648 | ||
| 2647 | 2649 | Create a string of hexadecimal numbers from a bytearray object. | |
| 2648 | 2650 | ||
@@ -2661,7 +2663,7 @@ Create a string of hexadecimal numbers from a bytearray object. | |||
| 2661 | 2663 | static PyObject * | |
| 2662 | 2664 | bytearray_hex_impl(PyByteArrayObject *self, PyObject *sep, | |
| 2663 | 2665 | Py_ssize_t bytes_per_sep) | |
| 2664 | - /*[clinic end generated code: output=c9563921aff1262b input=d2b23ef057cfcad5]*/ | ||
| 2666 | + /*[clinic end generated code: output=c9563921aff1262b input=9ed746203691e894]*/ | ||
| 2665 | 2667 | { | |
| 2666 | 2668 | char* argbuf = PyByteArray_AS_STRING(self); | |
| 2667 | 2669 | Py_ssize_t arglen = PyByteArray_GET_SIZE(self); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -277,8 +277,8 @@ _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len) | |||
| 277 | 277 | PyDoc_STRVAR_shared(_Py_title__doc__, | |
| 278 | 278 | "B.title() -> copy of B\n\ | |
| 279 | 279 | \n\ | |
| 280 | - Return a titlecased version of B, i.e. ASCII words start with uppercase\n\ | ||
| 281 | - characters, all remaining cased characters have lowercase."); | ||
| 280 | + Return a titlecased version of B, i.e. ASCII words start with\n\ | ||
| 281 | + uppercase characters, all remaining cased characters have lowercase."); | ||
| 282 | 282 | ||
| 283 | 283 | void | |
| 284 | 284 | _Py_bytes_title(char *result, const char *s, Py_ssize_t len) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments