Skip to content

Commit

Permalink
remove abstractmethod from __init__ and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed May 21, 2022
1 parent e777ac9 commit 9827a56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions autoregistry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Don't manually change, let poetry-dynamic-versioning-plugin handle it.
__version__ = "0.0.0"

from abc import abstractmethod

from .config import RegistryConfig
from .exceptions import (
CannotDeriveNameError,
Expand Down
8 changes: 4 additions & 4 deletions docs/source/Overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ it to create a ``Registry`` object.
Inheritence-Based
^^^^^^^^^^^^^^^^^
Generally, when inheriting ``Registry``, we are defining an interface, and thusly
an `abstract base class`_. The ``Registry`` class already inherits from ``ABCMeta``,
so the decorator ``@abstractmethod`` will automatically work with subclasses of ``Registry``.
For convenience, you can also import the ``@abstractmethod`` decorator from ``autoregistry``.
an `abstract base class`_. The ``Registry`` class is an instance of ``ABCMeta``,
so the ``abc`` decorator ``@abstractmethod`` will work with subclasses of ``Registry``.

.. code-block:: python
from autoregistry import Registry, abstractmethod
from abc import abstractmethod
from autoregistry import Registry
class Pokemon(Registry):
Expand Down
3 changes: 2 additions & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from abc import abstractmethod
from dataclasses import dataclass

from autoregistry import Registry, abstractmethod
from autoregistry import Registry


def construct_pokemon_classes(**kwargs):
Expand Down

0 comments on commit 9827a56

Please sign in to comment.