You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.2 KiB

4 years ago
  1. from __future__ import absolute_import, division, print_function
  2. class FrozenInstanceError(AttributeError):
  3. """
  4. A frozen/immutable instance has been attempted to be modified.
  5. It mirrors the behavior of ``namedtuples`` by using the same error message
  6. and subclassing :exc:`AttributeError`.
  7. .. versionadded:: 16.1.0
  8. """
  9. msg = "can't set attribute"
  10. args = [msg]
  11. class AttrsAttributeNotFoundError(ValueError):
  12. """
  13. An ``attrs`` function couldn't find an attribute that the user asked for.
  14. .. versionadded:: 16.2.0
  15. """
  16. class NotAnAttrsClassError(ValueError):
  17. """
  18. A non-``attrs`` class has been passed into an ``attrs`` function.
  19. .. versionadded:: 16.2.0
  20. """
  21. class DefaultAlreadySetError(RuntimeError):
  22. """
  23. A default has been set using ``attr.ib()`` and is attempted to be reset
  24. using the decorator.
  25. .. versionadded:: 17.1.0
  26. """
  27. class UnannotatedAttributeError(RuntimeError):
  28. """
  29. A class with ``auto_attribs=True`` has an ``attr.ib()`` without a type
  30. annotation.
  31. .. versionadded:: 17.3.0
  32. """
  33. class PythonTooOldError(RuntimeError):
  34. """
  35. An ``attrs`` feature requiring a more recent python version has been used.
  36. .. versionadded:: 18.2.0
  37. """