| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c3e5b10 commit 83fe2e1
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1236,7 +1236,8 @@ are always available. They are listed here in alphabetical order. | |||
| 1236 | 1236 | standard type hierarchy in :ref:`types`. | |
| 1237 | 1237 | ||
| 1238 | 1238 | ||
| 1239 | - .. function:: str([object[, encoding[, errors]]]) | ||
| 1239 | + .. function:: str(object='') | ||
| 1240 | + str(object[, encoding[, errors]]) | ||
| 1240 | 1241 | ||
| 1241 | 1242 | Return a string version of an object, using one of the following modes: | |
| 1242 | 1243 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,9 @@ What's New in Python 3.2.4 | |||
| 10 | 10 | Core and Builtins | |
| 11 | 11 | ----------------- | |
| 12 | 12 | ||
| 13 | + - Issue #14783: Improve int() docstring and switch docstrings for str(), | ||
| 14 | + range(), and slice() to use multi-line signatures. | ||
| 15 | + | ||
| 13 | 16 | - Issue #15379: Fix passing of non-BMP characters as integers for the charmap | |
| 14 | 17 | decoder (already working as unicode strings). Patch by Serhiy Storchaka. | |
| 15 | 18 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4703,13 +4703,20 @@ static PyGetSetDef long_getset[] = { | |||
| 4703 | 4703 | }; | |
| 4704 | 4704 | ||
| 4705 | 4705 | PyDoc_STRVAR(long_doc, | |
| 4706 | - "int(x[, base]) -> integer\n\ | ||
| 4706 | + "int(x=0) -> integer\n\ | ||
| 4707 | + int(x, base=10) -> integer\n\ | ||
| 4707 | 4708 | \n\ | |
| 4708 | - Convert a string or number to an integer, if possible. A floating\n\ | ||
| 4709 | - point argument will be truncated towards zero (this does not include a\n\ | ||
| 4710 | - string representation of a floating point number!) When converting a\n\ | ||
| 4711 | - string, use the optional base. It is an error to supply a base when\n\ | ||
| 4712 | - converting a non-string."); | ||
| 4709 | + Convert a number or string to an integer, or return 0 if no arguments\n\ | ||
| 4710 | + are given. If x is a number, return x.__int__(). For floating point\n\ | ||
| 4711 | + numbers, this truncates towards zero.\n\ | ||
| 4712 | + \n\ | ||
| 4713 | + If x is not a number or if base is given, then x must be a string,\n\ | ||
| 4714 | + bytes, or bytearray instance representing an integer literal in the\n\ | ||
| 4715 | + given base. The literal can be preceded by '+' or '-' and be surrounded\n\ | ||
| 4716 | + by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.\n\ | ||
| 4717 | + Base 0 means to interpret the base from the string as an integer literal.\n\ | ||
| 4718 | + >>> int('0b100', base=0)\n\ | ||
| 4719 | + 4"); | ||
| 4713 | 4720 | ||
| 4714 | 4721 | static PyNumberMethods long_as_number = { | |
| 4715 | 4722 | (binaryfunc)long_add, /*nb_add*/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -135,7 +135,8 @@ range_new(PyTypeObject *type, PyObject *args, PyObject *kw) | |||
| 135 | 135 | } | |
| 136 | 136 | ||
| 137 | 137 | PyDoc_STRVAR(range_doc, | |
| 138 | - "range([start,] stop[, step]) -> range object\n\ | ||
| 138 | + "range(stop) -> range object\n\ | ||
| 139 | + range(start, stop[, step]) -> range object\n\ | ||
| 139 | 140 | \n\ | |
| 140 | 141 | Returns a virtual sequence of numbers from start to stop by step."); | |
| 141 | 142 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -221,7 +221,8 @@ slice_new(PyTypeObject *type, PyObject *args, PyObject *kw) | |||
| 221 | 221 | } | |
| 222 | 222 | ||
| 223 | 223 | PyDoc_STRVAR(slice_doc, | |
| 224 | - "slice([start,] stop[, step])\n\ | ||
| 224 | + "slice(stop)\n\ | ||
| 225 | + slice(start, stop[, step])\n\ | ||
| 225 | 226 | \n\ | |
| 226 | 227 | Create a slice object. This is used for extended slicing (e.g. a[0:10:2])."); | |
| 227 | 228 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9986,7 +9986,8 @@ unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |||
| 9986 | 9986 | } | |
| 9987 | 9987 | ||
| 9988 | 9988 | PyDoc_STRVAR(unicode_doc, | |
| 9989 | - "str(object[, encoding[, errors]]) -> str\n\ | ||
| 9989 | + "str(object='') -> str\n\ | ||
| 9990 | + str(bytes_or_buffer[, encoding[, errors]]) -> str\n\ | ||
| 9990 | 9991 | \n\ | |
| 9991 | 9992 | Create a new string object from the given object. If encoding or\n\ | |
| 9992 | 9993 | errors is specified, then the object must expose a data buffer\n\ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments