10000 GH-106008: Make implicit boolean conversions explicit by brandtbucher · Pull Request #106003 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-106008: Make implicit boolean conversions explicit #106003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace UNARY_NOT with TO_BOOL
  • Loading branch information
brandtbucher committed Jun 9, 2023
commit 0463633b0f9583ad7aa322af4e9c0228949eed20
6 changes: 3 additions & 3 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ typedef struct {

typedef struct {
uint16_t counter;
} _PyUnaryNotCache;
} _PyToBoolCache;

#define INLINE_CACHE_ENTRIES_UNARY_NOT CACHE_ENTRIES(_PyUnaryNotCache)
#define INLINE_CACHE_ENTRIES_TO_BOOL CACHE_ENTRIES(_PyToBoolCache)

// Borrowed references to common callables:
struct callable_cache {
Expand Down Expand Up @@ -252,7 +252,7 @@ extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr,
int oparg);
extern void _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr, int oparg);
extern void _Py_Specialize_Send(PyObject *receiver, _Py_CODEUNIT *instr);
extern void _Py_Specialize_UnaryNot(PyObject *value, _Py_CODEUNIT *instr);
extern void _Py_Specialize_ToBool(PyObject *value, _Py_CODEUNIT *instr);

/* Finalizer function for static codeobjects used in deepfreeze.py */
extern void _PyStaticCode_Fini(PyCodeObject *co);
Expand Down
66 changes: 33 additions & 33 deletions Include/internal/pycore_opcode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

139 changes: 70 additions & 69 deletions Include/opcode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0