commit 52a1ad434dc74073db28428a349351e9e5e01541
parent b9db098bedfc5edd12ef4c3001345d118051d4cd
Author: quantumish <freifeld.david@gmail.com>
Date: Tue, 7 Jul 2026 14:54:15 +0100
Revert typecheck and subtree counting changes
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/retronews.py b/retronews.py
@@ -32,6 +32,7 @@ from datetime import datetime
from functools import partial, reduce
from textwrap import wrap
from typing import (
+ TYPE_CHECKING,
Any,
Callable,
Generator,
@@ -157,7 +158,12 @@ LB_URL_REX = re.compile(r"^https://lobste\.rs/s/([a-z0-9]{6}).*$")
# FIXME: Use TypeAlias after migrating to Python 3.10
DB = NewType("DB", "sqlite3.Connection")
-Window = NewType("Window", "curses.window")
+if TYPE_CHECKING:
+ from _curses import _CursesWindow
+
+ Window = _CursesWindow
+else:
+ Window = Any
T = TypeVar("T")
@@ -295,6 +301,7 @@ class HNSearchHit(TypedDict):
class HNEntry(TypedDict):
author: Optional[str]
+ # FIXME: Recursive declarations are not yet supported in TypedDicts
children: list[Any]
created_at_i: int
id: int