Skip to content

Commit 483405b

Browse files
Issue python#22883: Got rid of outdated references to PyInt and PyString in comments.
1 parent 77c041b commit 483405b

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

Lib/test/test_getargs2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
# > ** Changed from previous "range-and-a-half" to "none"; the
3535
# > range-and-a-half checking wasn't particularly useful.
3636
#
37-
# Plus a C API or two, e.g. PyInt_AsLongMask() ->
38-
# unsigned long and PyInt_AsLongLongMask() -> unsigned
37+
# Plus a C API or two, e.g. PyLong_AsUnsignedLongMask() ->
38+
# unsigned long and PyLong_AsUnsignedLongLongMask() -> unsigned
3939
# long long (if that exists).
4040

4141
LARGE = 0x7FFFFFFF

Modules/_io/_iomodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extern int _PyIO_trap_eintr(void);
6969
* Offset type for positioning.
7070
*/
7171

72-
/* Printing a variable of type off_t (with e.g., PyString_FromFormat)
72+
/* Printing a variable of type off_t (with e.g., PyUnicode_FromFormat)
7373
correctly and without producing compiler warnings is surprisingly painful.
7474
We identify an integer type whose size matches off_t and then: (1) cast the
7575
off_t to that integer type and (2) use the appropriate conversion

Modules/_json.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
827827

828828
static PyObject *
829829
_parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) {
830-
/* Read a JSON array from PyString pystr.
830+
/* Read a JSON array from PyUnicode pystr.
831831
idx is the index of the first character after the opening brace.
832832
*next_idx_ptr is a return-by-reference index to the first character after
833833
the closing brace.
@@ -899,8 +899,8 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
899899
}
900900

901901
static PyObject *
902-
_parse_constant(PyScannerObject *s, char *constant, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) {
903-
/* Read a JSON constant from PyString pystr.
902+
_parse_constant(PyScannerObject *s, const char *constant, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) {
903+
/* Read a JSON constant.
904904
constant is the constant string that was found
905905
("NaN", "Infinity", "-Infinity").
906906
idx is the index of the first character of the constant
@@ -932,7 +932,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
932932
the number.
933933
934934
Returns a new PyObject representation of that number:
935-
PyInt, PyLong, or PyFloat.
935+
PyLong, or PyFloat.
936936
May return other types if parse_int or parse_float are set
937937
*/
938938
void *str;

Modules/_sqlite/connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ typedef struct
5252
* first get called with count=0? */
5353
double timeout_started;
5454

55-
/* None for autocommit, otherwise a PyString with the isolation level */
55+
/* None for autocommit, otherwise a PyUnicode with the isolation level */
5656
PyObject* isolation_level;
5757

5858
/* NULL for autocommit, otherwise a string with the BEGIN statement; will be

Modules/fcntlmodule.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,8 @@ fcntl_ioctl_impl(PyModuleDef *module, int fd, unsigned int code, PyObject *ob_ar
152152
/*[clinic end generated code: output=ad47738c118622bf input=a55a6ee8e494c449]*/
153153
{
154154
#define IOCTL_BUFSZ 1024
155-
/* We use the unsigned non-checked 'I'
156-
format for the 'code' parameter because Python turns 0x8000000
157-
into either a large positive number (PyLong or PyInt on 64-bit
158-
platforms) or a negative number on others (32-bit PyInt)
159-
whereas the system expects it to be a 32bit bit field value
155+
/* We use the unsigned non-checked 'I' format for the 'code' parameter
156+
because the system expects it to be a 32bit bit field value
160157
regardless of it being passed as an int or unsigned long on
161158
various platforms. See the termios.TIOCSWINSZ constant across
162159
platforms for an example of this.

Modules/itertoolsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3874,7 +3874,7 @@ typedef struct {
38743874
38753875
fast_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified.
38763876
3877-
assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyInt(1));
3877+
assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyLong(1));
38783878
Advances with: cnt += 1
38793879
When count hits Y_SSIZE_T_MAX, switch to slow_mode.
38803880

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4606,7 +4606,7 @@ ext_do_call(PyObject *func, PyObject ***pp_stack, int flags, int na, int nk)
46064606
return result;
46074607
}
46084608

4609-
/* Extract a slice index from a PyInt or PyLong or an object with the
4609+
/* Extract a slice index from a PyLong or an object with the
46104610
nb_index slot defined, and store in *pi.
46114611
Silently reduce values larger than PY_SSIZE_T_MAX to PY_SSIZE_T_MAX,
46124612
and silently boost values less than -PY_SSIZE_T_MAX-1 to -PY_SSIZE_T_MAX-1.

0 commit comments

Comments
 (0)