mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)
This commit is contained in:
parent
39fa19a4cc
commit
685fd74f81
10 changed files with 185 additions and 125 deletions
|
@ -414,10 +414,16 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_GUARD_TOS_UNICODE, (value -- value)) {
|
||||
if (sym_matches_type(value, &PyUnicode_Type)) {
|
||||
REPLACE_OP(this_instr, _NOP, 0, 0);
|
||||
}
|
||||
sym_set_type(value, &PyUnicode_Type);
|
||||
}
|
||||
|
||||
op(_TO_BOOL_STR, (value -- res)) {
|
||||
if (!optimize_to_bool(this_instr, ctx, value, &res)) {
|
||||
res = sym_new_truthiness(ctx, value, true);
|
||||
sym_set_type(value, &PyUnicode_Type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue