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

python-dictattr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-dictattr - npm Package Compare versions

Comparing version
0.0.2
to
0.0.3
+25
-6
dictattr/__init__.py

@@ -7,3 +7,3 @@ #!/usr/bin/env python3

__author__ = "ChenyangGao <https://chenyanggao.github.io>"
__version__ = (0, 0, 2)
__version__ = (0, 0, 3)
__all__ = [

@@ -29,3 +29,9 @@ "odict", "AttrDict", "MapAttr", "MuMapAttr",

def __hash__(self, /) -> int: # type: ignore
return id(self)
def __eq__(self, value, /) -> bool:
return self is value or super().__eq__(value)
class AttrDict(dict[K, V]):

@@ -37,10 +43,15 @@

def __hash__(self, /) -> int: # type: ignore
return id(self)
def __eq__(self, value, /) -> bool:
return self is value or super().__eq__(value)
@Mapping.register
class MapAttr(Generic[K, V]):
def __init__(self, d: None | dict = None, /):
def __init__(self, /, *args, **kwds):
self.__dict__: dict[K, V] # type: ignore
if d is not None:
self.__dict__ = d
self.__dict__.update(*args, **kwds)

@@ -67,4 +78,12 @@ def __contains__(self, key, /) -> bool:

@classmethod
def of(cls, /, *args, **kwds) -> Self:
return cls(dict(*args, **kwds))
def of(
cls,
d: None | dict[K, V] = None,
/,
) -> Self:
if d is None:
return cls()
self = __class__.__new__(cls) # type: ignore
self.__dict__ = d
return self

@@ -71,0 +90,0 @@

+1
-1
Metadata-Version: 2.1
Name: python-dictattr
Version: 0.0.2
Version: 0.0.3
Summary: Python dictattr.

@@ -5,0 +5,0 @@ Home-page: https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/python-dictattr

[tool.poetry]
name = "python-dictattr"
version = "0.0.2"
version = "0.0.3"
description = "Python dictattr."

@@ -5,0 +5,0 @@ authors = ["ChenyangGao <wosiwujm@gmail.com>"]