Abstract class attributes
Project description
abcattrs
Abstract class attributes for ABCs.
Examples
import abc
from abcattrs import abstractattrs, Abstract
@abstractattrs
class A(abc.ABC):
foo: Abstract[int]
# Abstract subclasses can add more required attributes.
class B(A, abc.ABC):
bar: Abstract[str]
class C(B):
# C must assign values to both of these attributes to not raise an error.
foo = 1
bar = "str"
# This raises an error.
class MissingBar(B):
foo = 1
# This raises an error.
class MissingFoo(B):
bar = "str"
The Abstract qualifier can be combined with other PEP 593 annotations.
from typing import Annotated
import abc
from abcattrs import abstractattrs, Abstract
@abstractattrs
class A(abc.ABC):
# Combine with other annotations
bar: Annotated[str, Abstract, "other info"]
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
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 abcattrs-0.6.1.tar.gz.
File metadata
- Download URL: abcattrs-0.6.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b72e096890a704bce06ac16c6b7d49c25b30dff27a601d0fdd5d9984b78ec1a1
|
|
| MD5 |
2d60a2dd6abcad0af7331863081e5a23
|
|
| BLAKE2b-256 |
6d97bfaf421cc15ea18f07dade4088a1a2c43f318bfdee62649cf5001bc60d8e
|
Provenance
The following attestation bundles were made for abcattrs-0.6.1.tar.gz:
Publisher:
release.yaml on antonagestam/abcattrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abcattrs-0.6.1.tar.gz -
Subject digest:
b72e096890a704bce06ac16c6b7d49c25b30dff27a601d0fdd5d9984b78ec1a1 - Sigstore transparency entry: 569710463
- Sigstore integration time:
-
Permalink:
antonagestam/abcattrs@b96d412df521c43fa2e176de06638d1572870add -
Branch / Tag:
refs/tags/0.6.1 - Owner: https://github.com/antonagestam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@b96d412df521c43fa2e176de06638d1572870add -
Trigger Event:
release
-
Statement type:
File details
Details for the file abcattrs-0.6.1-py3-none-any.whl.
File metadata
- Download URL: abcattrs-0.6.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
595d19e9a5e622f2bfb05e8b139eec8d4068b439ed1f6c332620b1dba8741fe8
|
|
| MD5 |
1a08990a817cebbf461dc2250ab52f7a
|
|
| BLAKE2b-256 |
7696ba2d0ed033a71d1bb7dbf7082c43e2254d1edf03b346787b99f0d051d7bc
|
Provenance
The following attestation bundles were made for abcattrs-0.6.1-py3-none-any.whl:
Publisher:
release.yaml on antonagestam/abcattrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abcattrs-0.6.1-py3-none-any.whl -
Subject digest:
595d19e9a5e622f2bfb05e8b139eec8d4068b439ed1f6c332620b1dba8741fe8 - Sigstore transparency entry: 569710475
- Sigstore integration time:
-
Permalink:
antonagestam/abcattrs@b96d412df521c43fa2e176de06638d1572870add -
Branch / Tag:
refs/tags/0.6.1 - Owner: https://github.com/antonagestam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@b96d412df521c43fa2e176de06638d1572870add -
Trigger Event:
release
-
Statement type: