general: move assert_never to my.core.compat as it's in stdlib from 3.11

rely on typing-extensions for fallback

introducing typing-extensions dependency without fallback, should be ok since it's in the top 10 of popular packages
This commit is contained in:
Dima Gerasimov 2024-08-12 15:45:59 +03:00 committed by karlicoss
parent 1317914bff
commit a7439c7846
10 changed files with 36 additions and 16 deletions

View file

@ -121,3 +121,15 @@ if sys.version_info[:2] >= (3, 10):
from types import NoneType
else:
NoneType = type(None)
if sys.version_info[:2] >= (3, 13):
from warnings import deprecated
else:
from typing_extensions import deprecated
if sys.version_info[:2] >= (3, 11):
from typing import assert_never
else:
from typing_extensions import assert_never