objectdict
Project description
使用方法
import json
from unittest import TestCase
from objectdict import ObjectDict
class TestObjectDict(TestCase):
def test_value(self):
class SimpleObjectDict(ObjectDict):
int_field: int = 1
str_field = 'a'
dict_field = {}
int2_f: int
_protect = 'protect'
@classmethod
def classmethod(cls):
pass
@property
def proty(cls):
return 'property'
def asd(self):
return 'asd'
self.assertEqual(ObjectDict(), {})
self.assertEqual(SimpleObjectDict().int_field, 1)
self.assertEqual(SimpleObjectDict().str_field, 'a')
self.assertEqual(SimpleObjectDict().dict_field, {})
self.assertEqual(SimpleObjectDict(), SimpleObjectDict().from_json(json.dumps(SimpleObjectDict())))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objectdict-1.0.3.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for objectdict-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3976352f2f2bd12e19b9e92b7cb133376319dc292362bec64dd804c82f3b60f0 |
|
MD5 | d6f6a06aa84241c31cc98787e880dd03 |
|
BLAKE2b-256 | 9538d6098e7adf626ad3f67057a2cf98c01476c80e38244c175de89023a37f5e |