Skip to content

Commit 22a2e04

Browse files
committed
Add static data for endswith; fix test typing
1 parent 866694a commit 22a2e04

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
@@ -52,6 +52,7 @@ intern_strings(void) {
5252
INTERN_STRING(close_, "close");
5353
INTERN_STRING(copy, "copy");
5454
INTERN_STRING(dispatch_cache, "dispatch_cache");
55+
INTERN_STRING(endswith, "endswith");
5556
INTERN_STRING(get_type_hints, "get_type_hints");
5657
INTERN_STRING(keys, "keys");
5758
INTERN_STRING(items, "items");

mypyc/lib-rt/static_data.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typedef struct mypyc_interned_str_struct {
4444
PyObject *close_;
4545
PyObject *copy;
4646
PyObject *dispatch_cache;
47+
PyObject *endswith;
4748
PyObject *get_type_hints;
4849
PyObject *keys;
4950
PyObject *items;

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)