Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_exc.py37 linesDownload Raw Back to bidict
1# Copyright 2009-2024 Joshua Bronson. All rights reserved.2#3# This Source Code Form is subject to the terms of the Mozilla Public4# License, v. 2.0. If a copy of the MPL was not distributed with this5# file, You can obtain one at http://mozilla.org/MPL/2.0/.6 7 8"""Provide all bidict exceptions."""9 10from __future__ import annotations11 12 13class BidictException(Exception):14    """Base class for bidict exceptions."""15 16 17class DuplicationError(BidictException):18    """Base class for exceptions raised when uniqueness is violated19    as per the :attr:`~bidict.RAISE` :class:`~bidict.OnDupAction`.20    """21 22 23class KeyDuplicationError(DuplicationError):24    """Raised when a given key is not unique."""25 26 27class ValueDuplicationError(DuplicationError):28    """Raised when a given value is not unique."""29 30 31class KeyAndValueDuplicationError(KeyDuplicationError, ValueDuplicationError):32    """Raised when a given item's key and value are not unique.33 34    That is, its key duplicates that of another item,35    and its value duplicates that of a different other item.36    """37 
codekingpro/portable-devtools · Team Ai