Catalog PyPI
PACKAGE EXPLORERView in registry

abcattrs

PyPI

Abstract class attributes

Versions collected1
Direct dependencies5From release 0.6.1
Last observed20 Oct, 17:13 UTC

README

Version 0.6.1 documentation

abcattrs

CI Build Status
PyPI Package Python versions

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"]

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.6.129 Sept 20255

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
antonagestam/abcattrs

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d997ee18650c0ae2d1a531f76b11b7a85d78f02a756d0d9be9c82127e02f43e0