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.2.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for objectdict-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ed60b5891bc2b671f0914facdb7bfd9cb6257eff7ee251895a311867aac520a |
|
MD5 | dde803030bcf123aae41187b3a4ce724 |
|
BLAKE2b-256 | c4f53a4427a8b668d37d482a577c51aed119163ea5f61c8ffc9be50bbf493f1b |