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
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
struct_types-0.0.0.tar.gz
(1.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f2a7bc9f4d513bee5d446dbf2ac8b60807b4f3bb482084d1702cbb9fbd93cc
|
|
| MD5 |
3d4475aa3cda24d473e1b8ff581cd0d5
|
|
| BLAKE2b-256 |
c422d8e1e0f2f838be162ba197b3d5d24b42bcb88ec405e2fb775362a4bd8887
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8cbd8acee1e2985b72b047a0a6bb4989a7a20aa109fe0211d7b8eb607f6d128
|
|
| MD5 |
e595b42c96e486b79470ed0e7dc8948e
|
|
| BLAKE2b-256 |
d6a6b58fadfc6673f5bcb2552a06640f564ab04dd78cbe42e87d82335a4e0189
|