Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

axabc

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axabc - npm Package Compare versions

Comparing version
0.0.62
to
0.0.63
+7
axabc/types/__init__.py
from .type_cheat import TypeCheat
__all__ = [
'TypeCheat',
]
from typing import Generic, TypeVar, TYPE_CHECKING
TPrimaryType = TypeVar('TPrimaryType')
class TypeCheat(Generic[TPrimaryType]):
PrimaryType: type[TPrimaryType]
__abstract__ = True
if TYPE_CHECKING:
from typing import Self
def __new__(cls, *args, **kwargs) -> 'Self':
is_abstract = getattr(cls.__dict__, '__abstract__', False)
print(f'{is_abstract=}; {cls.PrimaryType=}')
if getattr(cls.__dict__, '__abstract__', False):
return super().__new__(cls)
return cls.PrimaryType(*args, **kwargs) # type: ignore
def __init_subclass__(cls) -> None:
if getattr(cls.__dict__, '__abstract__', False):
return
cls_name = cls.__new__
if (
not (bases := getattr(cls, "__orig_bases__"))
or not (generics := getattr(bases[0], '__args__'))
):
raise RuntimeError(
f"Can't create fake type for {cls.__name__}"
"because it doesn't have any generic parameters"
"Use Example:\n"
f"class Some{cls_name}({cls_name}[SomeType]):\n\tpass"
)
cls.PrimaryType: type[TPrimaryType] = generics[-1]
+1
-1
Metadata-Version: 2.1
Name: axabc
Version: 0.0.62
Version: 0.0.63
Summary: library that defines abstractions for some repeated essences

@@ -5,0 +5,0 @@ Author: axdjuraev

@@ -32,2 +32,4 @@ README.md

axabc/test/__init__.py
axabc/test/base_async_test.py
axabc/test/base_async_test.py
axabc/types/__init__.py
axabc/types/type_cheat.py
Metadata-Version: 2.1
Name: axabc
Version: 0.0.62
Version: 0.0.63
Summary: library that defines abstractions for some repeated essences

@@ -5,0 +5,0 @@ Author: axdjuraev