
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Data types not found in the standard library that are cool in various different ways ;)
Advanced DataTypes is a package for Python that provides access faster, feature-rich data types not provided in the standard library, motivated by my thoughts of "why is that not a thing?" The aim of the project is to fill out the holes in the standard library data types' feature-set while improving upon the performance of the existing feature-set.
Constant Store is a class that provides a namespace within which to store constants on a class attribute basis. Class definition is very simple:
from advanced_dtypes import ConstStore
class Example(ConstStore):
NAME_1 = "some_value"
NAME_2 = 23
The class is built to populate a set and dictionary on import, which drives many of the features of the class, as well as the __slots__ attribute, which helps boost performance. Since the class attributes are maintained, names can be directly dot-referenced.
>> Example.NAME_1 == "some_value"
True
>> type(Example.NAME_1) == str
True
ConstStore
also provides an interface for the following functionality:
>> len(Example)
2
>> 23 in Example
True
>> Example(23)
NAME_2
>> Example["NAME_2"]
23
>> [value for value in Example]
["some_value", 23]
You should be aware, however, that non-hashable objects will have slower performance in lookups such as in
, Class(value)
and Class[name]
.
FastEnum
is simply a faster implementation of the existing standard library Enum
.
Definition is exactly the same as a standard enum:
from advanced_dtypes import FastEnum
class Example(FastEnum):
NAME_1 = "some_value"
NAME_2 = 23
Similarly, standard enum functionality remains:
>> Example.NAME_1
<Example.NAME_1: some_value>
>> Example.NAME_1.name
NAME_1
>> Example.NAME_1.value
some_value
>> Example("some_value")
<Example.NAME_1: some_value>
>> Example["NAME_1"]
<Example.NAME_1: some_value>
>> len(Example)
2
>> [item for item in Example]
[<Example.NAME_1: some_value>, <Example.NAME_2: 23>]
>> Example.NAME_1 == Example.NAME_1
True
The only functional addition in this instance is equality checking of members against values directly:
>> Example.NAME_1 == "some_value"
True
pip install advanced-dtypes
FAQs
Data types not found in the standard library that are cool in various different ways ;)
We found that advanced-dtypes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.