Skip to main content

Static + runtime class declaration level interface validation

Project description

Struct Types

Validate your classes against interfaces the familiar way, just import does

Example

from abc import abstractmethod
from typing import Protocol, runtime_checkable

from does import does

@runtime_checkable
class Notifier(Protocol):
    @abstractmethod
    def notify(self):
        pass


class EmailService:
    def __init__(self):
        does(Notifier).match(EmailService)
        # Type mismatch; EmailService does not implement .notify

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

struct_types-0.0.0.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

struct_types-0.0.0-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file struct_types-0.0.0.tar.gz.

File metadata

  • Download URL: struct_types-0.0.0.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.12.0

File hashes

Hashes for struct_types-0.0.0.tar.gz
Algorithm Hash digest
SHA256 23f2a7bc9f4d513bee5d446dbf2ac8b60807b4f3bb482084d1702cbb9fbd93cc
MD5 3d4475aa3cda24d473e1b8ff581cd0d5
BLAKE2b-256 c422d8e1e0f2f838be162ba197b3d5d24b42bcb88ec405e2fb775362a4bd8887

See more details on using hashes here.

File details

Details for the file struct_types-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: struct_types-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.12.4 CPython/3.12.0

File hashes

Hashes for struct_types-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8cbd8acee1e2985b72b047a0a6bb4989a7a20aa109fe0211d7b8eb607f6d128
MD5 e595b42c96e486b79470ed0e7dc8948e
BLAKE2b-256 d6a6b58fadfc6673f5bcb2552a06640f564ab04dd78cbe42e87d82335a4e0189

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page