Skip to content

Commit b47ca2b

Browse files
committed
Remove cherry-pick artifacts (testStrMultiply, testConstantFoldFormatArgs, CPyStr_Multiply)
1 parent 5430546 commit b47ca2b

6 files changed

Lines changed: 2 additions & 41 deletions

File tree

mypy/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - Release versions have the form "1.2.3".
99
# - Dev versions have the form "1.2.3+dev" (PLUS sign to conform to PEP 440).
1010
# - Before 1.0 we had the form "0.NNN".
11-
__version__ = "1.19.1"
11+
__version__ = "1.19.1.post1"
1212
base_version = __version__
1313

1414
mypy_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

mypyc/irbuild/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ def add_var_to_env_class(
13991399
if always_defined:
14001400
self.fn_info.env_class.attrs_with_defaults.add(name)
14011401
if base._curr_env_reg is None:
1402-
return
1402+
return None # type: ignore[return-value]
14031403
attr_target = AssignmentTargetAttr(base.curr_env_reg, name)
14041404

14051405
if reassign:

mypyc/lib-rt/CPy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ PyObject *CPy_Encode(PyObject *obj, PyObject *encoding, PyObject *errors);
770770
Py_ssize_t CPyStr_Count(PyObject *unicode, PyObject *substring, CPyTagged start);
771771
Py_ssize_t CPyStr_CountFull(PyObject *unicode, PyObject *substring, CPyTagged start, CPyTagged end);
772772
CPyTagged CPyStr_Ord(PyObject *obj);
773-
PyObject *CPyStr_Multiply(PyObject *str, CPyTagged count);
774773
PyObject *CPyStr_Lower(PyObject *str);
775774
PyObject *CPyStr_Upper(PyObject *str);
776775
bool CPyStr_IsSpace(PyObject *str);

mypyc/lib-rt/str_ops.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -622,15 +622,6 @@ CPyTagged CPyStr_Ord(PyObject *obj) {
622622
return CPY_INT_TAG;
623623
}
624624

625-
PyObject *CPyStr_Multiply(PyObject *str, CPyTagged count) {
626-
Py_ssize_t temp_count = CPyTagged_AsSsize_t(count);
627-
if (temp_count == -1 && PyErr_Occurred()) {
628-
PyErr_SetString(PyExc_OverflowError, CPYTHON_LARGE_INT_ERRMSG);
629-
return NULL;
630-
}
631-
return PySequence_Repeat(str, temp_count);
632-
}
633-
634625

635626
bool CPyStr_IsSpace(PyObject *str) {
636627
Py_ssize_t len = PyUnicode_GET_LENGTH(str);

mypyc/test-data/irbuild-str.test

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -772,27 +772,6 @@ L0:
772772
r1 = 'literal'
773773
return 1
774774

775-
[case testStrMultiply]
776-
def s_times_i(s: str, n: int) -> str:
777-
return s * n
778-
def i_times_s(s: str, n: int) -> str:
779-
return n * s
780-
[out]
781-
def s_times_i(s, n):
782-
s :: str
783-
n :: int
784-
r0 :: str
785-
L0:
786-
r0 = CPyStr_Multiply(s, n)
787-
return r0
788-
def i_times_s(s, n):
789-
s :: str
790-
n :: int
791-
r0 :: str
792-
L0:
793-
r0 = CPyStr_Multiply(s, n)
794-
return r0
795-
796775
[case testStrLower]
797776
def do_lower(s: str) -> str:
798777
return s.lower()

mypyc/test-data/run-strings.test

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,14 +1104,6 @@ def test_optional_ne() -> None:
11041104
assert ne_s_opt_s_opt(None, 'x')
11051105
assert ne_s_opt_s_opt('x', None)
11061106

1107-
[case testConstantFoldFormatArgs]
1108-
from typing import Final
1109-
1110-
FMT: Final = "{} {}"
1111-
1112-
def test_format() -> None:
1113-
assert FMT.format(400 + 20, "roll" + "up") == "420 rollup"
1114-
11151107
[case testLowerAndUpper]
11161108
from typing import Any
11171109

0 commit comments

Comments
 (0)