[Lldb-commits] [lldb] [lldb] Avoid NotRequired for Python < 3.11 compatibility (PR #192723)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 17 12:42:27 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Jonas Devlieghere (JDevlieghere)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/192723.diff
1 Files Affected:
- (modified) lldb/scripts/gen-property-docs-from-json.py (+2-19)
``````````diff
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:
``````````
</details>
https://github.com/llvm/llvm-project/pull/192723
More information about the lldb-commits
mailing list