mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-46753: Add the empty tuple to the _PyRuntimeState.global_objects. (gh-31345)
https://bugs.python.org/issue46753
This commit is contained in:
parent
d5b7bba43b
commit
08deed1af5
8 changed files with 218 additions and 204 deletions
|
@ -287,6 +287,8 @@ class Printer:
|
|||
return f"& {name}.ob_base"
|
||||
|
||||
def generate_tuple(self, name: str, t: Tuple[object, ...]) -> str:
|
||||
if len(t) == 0:
|
||||
return f"(PyObject *)& _Py_SINGLETON(tuple_empty)"
|
||||
items = [self.generate(f"{name}_{i}", it) for i, it in enumerate(t)]
|
||||
self.write("static")
|
||||
with self.indent():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue