Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce TrashedError #123

Open
noyainrain opened this issue Dec 17, 2020 · 1 comment
Open

Introduce TrashedError #123

noyainrain opened this issue Dec 17, 2020 · 1 comment

Comments

@noyainrain
Copy link
Owner

Introduce an own error for modifying trashed objects.

@noyainrain
Copy link
Owner Author

Draft:

class Trashable:
    """
    .. describe:: trashed

       A trashed object cannot be modified and a :ref:`TrashedError` is returned in this case.
    """

    def check_trashed(self) -> None:
        """Subclass API: Check that the object is not :attr:`trashed`."""

class TrashedError(ValueError):
    """Returned if it is not possible to perform an action because the object is trashed."""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant