Skip to content

Commit a5ce9bb

Browse files
committed
cite cached_property
1 parent bc96aac commit a5ce9bb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/textual/_compat.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
if sys.version_info >= (3, 12):
77
from functools import cached_property
88
else:
9+
# based on the code from Python 3.14:
10+
# https://github.com/python/cpython/blob/
11+
# 5507eff19c757a908a2ff29dfe423e35595fda00/Lib/functools.py#L1089-L1138
12+
# Copyright (C) 2006 Python Software Foundation.
13+
# vendored under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 because
14+
# prior to Python 3.12 cached_property used a threading.Lock, which makes
15+
# it very slow.
916
_T_co = TypeVar("_T_co", covariant=True)
1017
_NOT_FOUND = object()
1118

0 commit comments

Comments
 (0)