Skip to content

Commit 4c55a57

Browse files
committed
Add static data for endswith; fix test typing
1 parent c4f5081 commit 4c55a57

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

mypyc/lib-rt/static_data.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ intern_strings(void) {
4646
INTERN_STRING(clear, "clear");
4747
INTERN_STRING(close_, "close");
4848
INTERN_STRING(copy, "copy");
49+
INTERN_STRING(endswith, "endswith");
4950
INTERN_STRING(keys, "keys");
5051
INTERN_STRING(items, "items");
5152
INTERN_STRING(join, "join");

mypyc/lib-rt/static_data.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typedef struct mypyc_interned_str_struct {
3838
PyObject *clear;
3939
PyObject *close_;
4040
PyObject *copy;
41+
PyObject *endswith;
4142
PyObject *keys;
4243
PyObject *items;
4344
PyObject *join;

mypyc/test-data/run-bytes.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ def test_endswith() -> None:
238238
assert test.endswith(bytearray(b'string'))
239239
assert not test.endswith(bytearray(b'other'))
240240

241-
test = bytearray(b'some string')
242-
assert test.endswith(b'string')
243-
assert not test.endswith(b'other')
241+
test2 = bytearray(b'some string')
242+
assert test2.endswith(b'string')
243+
assert not test2.endswith(b'other')
244244

245245
[case testBytesSlicing]
246246
def test_bytes_slicing() -> None:

0 commit comments

Comments
 (0)