[Lldb-commits] [lldb] [lldb] Avoid NotRequired for Python < 3.11 compatibility (PR #192723)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 17 12:41:55 PDT 2026


https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/192723

NotRequired was added in Python 3.11, while the minimum supported Python for LLDB is 3.8. Avoid it by using `Dict[str, Any]` instead.

>From c64cba8870c9c215dafbb1aa7d66502c8d854940 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Fri, 17 Apr 2026 12:40:13 -0700
Subject: [PATCH] [lldb] Avoid NotRequired for Python < 3.11 compatibility

NotRequired was added in Python 3.11, while the minimum supported Python
for LLDB is 3.8. Avoid it by using `Dict[str, Any]` instead.
---
 lldb/scripts/gen-property-docs-from-json.py | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/lldb/scripts/gen-property-docs-from-json.py b/lldb/scripts/gen-property-docs-from-json.py
index e7de4ea2f4120..5d90f9f7ec8e1 100644
--- a/lldb/scripts/gen-property-docs-from-json.py
+++ b/lldb/scripts/gen-property-docs-from-json.py
@@ -1,28 +1,11 @@
 import argparse
-from typing import TypedDict, Union, Optional, TextIO, NotRequired
+from typing import Any, Dict, TypedDict, Union, Optional, TextIO
 from dataclasses import dataclass
 import json
 import re
 
 
-PropertyDef = TypedDict(
-    "PropertyDef",
-    {
-        "!superclasses": list[str],
-        "Name": str,
-        "Path": str,
-        "Type": str,
-        "Description": NotRequired[str],
-        "HasDefaultUnsignedValue": NotRequired[int],
-        "HasDefaultBooleanValue": NotRequired[int],
-        "DefaultUnsignedValue": NotRequired[int],
-        "HasDefaultStringValue": NotRequired[int],
-        "DefaultStringValue": NotRequired[str],
-        "HasDefaultEnumValue": NotRequired[int],
-        "DefaultEnumValue": NotRequired[str],
-        "EnumValues": NotRequired[str],
-    },
-)
+PropertyDef = Dict[str, Any]
 
 
 class Property:



More information about the lldb-commits mailing list