plain-abc
Another ABC implementation without metaclass.
It is a little bit annoying to have metaclass conflict,
especially when trying to use ABC along with other libraries.
plain-abc provides a simple ABC implementation without metaclass.
Installation
pip install plain-abc
Usage
But you can also use plain-abc to solve the problem:
from abc import abstractmethod
from plain_abc import PlainABC
class _SomeHiddenMetaclass(type):
pass
class Base(metaclass=_SomeHiddenMetaclass):
pass
class IFoo(PlainABC):
@abstractmethod
def foo(self): ...
class Foo(Base, IFoo):
def foo(self): ...
To extend an abstract class as another abstract class,
PlainABC is required to be one of the bases:
from abc import abstractmethod
from plain_abc import PlainABC
class IEntity(PlainABC):
@abstractmethod
def get_id(self) -> str: ...
class IProjectile(IEntity, PlainABC):
@abstractmethod
def get_speed(self) -> float: ...
class Arrow(IProjectile):
def get_id(self) -> str: ...
def get_speed(self) -> float: ...
To skip signature checking,
you can add the member names in __abc_concrete_members__ of a subclass:
from abc import abstractmethod
from enum import Enum
from plain_abc import PlainABC
class IEnum(PlainABC):
@property
@abstractmethod
def foo(self) -> str:
...
class Foo(IEnum, Enum):
# for python 3.10 or lower
__abc_concrete_members__ = ('foo',)
foo = 'foo'
assert Foo.foo.value == 'foo'
To solve metaclass conflict without plain-abc
Here is an example of metaclass conflict
and how to mix ABCMeta with other metaclasses.
from abc import ABC, ABCMeta, abstractmethod
class _SomeHiddenMetaclass(type):
...
class Base(metaclass=_SomeHiddenMetaclass):
...
class IFoo(ABC):
@abstractmethod
def foo(self): ...
# oh no, metaclass conflict!
# class Foo(Base, IFoo):
# def foo(self): ...
# create a new metaclass to solve the conflict
class NewMetaclass(_SomeHiddenMetaclass, ABCMeta):
...
class Foo(Base, IFoo, metaclass=NewMetaclass):
def foo(self): ...
Metadata
Release files for plain-abc 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| plain_abc-0.1.1.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plain_abc-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / plain_abc-0.1.1.tar.gz
| Download URL | plain_abc-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b89e7308ed1c5340d15fe2c3bfeb90eb639c4bbba0e6fef0206a7447d3b1ce1
|
|
BLAKE2b-256 checksum How to use checksums |
09b08697790096e45a950673a7f2903ea6b33057fe2e2b06d4eac8d6f9324fde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency logRelease files / plain_abc-0.1.1-py3-none-any.whl
| Download URL | plain_abc-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63f4275327f24f1aca84d8d4bf474551ffd2f1896f413157141ce008cc5605a2
|
|
BLAKE2b-256 checksum How to use checksums |
85d641c7ed0c98a2f0a6891eabc0dd5081bce05d756a6b7d2cac67498fd4efe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency log