Skip to main content

使用方法

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())))

Metadata

Release files for objectdict 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for objectdict 1.0.3
File Size Uploaded Provenance Actions
objectdict-1.0.3.tar.gz 2.9 kB Without provenance Details for objectdict-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for objectdict 1.0.3
File Interpreter ABI Platform Actions
objectdict-1.0.3-py3-none-any.whl Python 3 none any Details for objectdict-1.0.3-py3-none-any.whl

Total release size: 5.2 kB

Release files / objectdict-1.0.3.tar.gz

Download URL objectdict-1.0.3.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
439d4328085839023cbbb0b8146d7600c8bcb497ef89817c21bac7443ee7b686
BLAKE2b-256 checksum
How to use checksums
d8cef03ce2d459e274c8f719cb39cd71da52a8efcf7511975ab39721d78d8867
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.2

Release files / objectdict-1.0.3-py3-none-any.whl

Download URL objectdict-1.0.3-py3-none-any.whl
Size 2.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3976352f2f2bd12e19b9e92b7cb133376319dc292362bec64dd804c82f3b60f0
BLAKE2b-256 checksum
How to use checksums
9538d6098e7adf626ad3f67057a2cf98c01476c80e38244c175de89023a37f5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.2

Security for objectdict 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page