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.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for objectdict-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d42f1ea7e018267d59fd22fd42961e3a8f3da6273c2d1fe47144b92104ccdca6 |
|
MD5 | a317bcffcaf5c8c29f6ddea1b84a5e3b |
|
BLAKE2b-256 | a67e95b5dae6d4abce2453b926d462a7ce6fa2d665dd5da4f9d7acd3171ce55e |