Make `T_Buffer` type variable visible at runtime again
Marco Ricci

Marco Ricci commited on 2025-01-20 15:21:59
Zeige 1 geänderte Dateien mit 0 Einfügungen und 3 Löschungen.


Apparently this is necessary to keep the class properly importable:
subclassing `typing.Generic` with a runtime-invisible type variable or
with a string fails.
... ...
@@ -579,7 +579,6 @@ def clean_up_falsy_vault_config_values(  # noqa: C901,PLR0912
579 579
     return cleanup_completed
580 580
 
581 581
 
582
-if TYPE_CHECKING:
583 582
 T_Buffer = TypeVar('T_Buffer', bound=Buffer)
584 583
 """
585 584
 A [`TypeVar`][] for classes implementing the [`Buffer`][] interface.
... ...
@@ -589,8 +588,6 @@ if TYPE_CHECKING:
589 588
     purposes only.  Subject to change without notice, including
590 589
     removal.
591 590
 
592
-        Additionally, this type variable is inaccessible at runtime.
593
-
594 591
 """
595 592
 
596 593
 
597 594