Linux repositories inspector

python2-attrs - Python attributes without boilerplate

attrs is an MIT-licensed Python package with class decorators that ease the chores of implementing the most common attribute-related object protocols.
You just specify the attributes to work with and attrs gives you:
  • a nice human-readable __repr__,
  • a complete set of comparison methods,
  • an initializer,
  • and much more

without writing dull boilerplate code again and again.

This gives you the power to use actual classes with actual types in your code instead of confusing tuples or confusingly behaving namedtuples.
So put down that type-less data structures and welcome some class into your life!

python-attrs is the successor to python-characterstic
19.1.0
Arch iconArch rolling
Fedora iconFedora rawhide
Manjaro iconManjaro rolling
OpenSUSE iconOpenSUSE Tumbleweed
17.4.0
CentOS iconCentOS 7.6.1810
Fedora iconFedora 28
Fedora iconFedora 29
OpenSUSE iconOpenSUSE Leap 15.0
OpenSUSE iconOpenSUSE Leap 15.1
DistributionVersionSincePackageInstalledPackager
Arch iconArch rolling extra/osxz19.1.0-115.03.201949.1 kiB305 kiB
CentOS iconCentOS 7.6.1810 cloud/openstack-rockyrpm17.4.0-4.el723.01.201947.3 kiB163 kiB
Fedora iconFedora 28 releases/Everything-osrpm17.4.0-2.fc2814.01.201950.9 kiB163 kiBFedora Project
Fedora iconFedora 29 releases/Everything-osrpm17.4.0-7.fc2914.01.201951.6 kiB163 kiBFedora Project
Fedora iconFedora 29 releases-test/Everything-osrpm17.4.0-7.fc2914.01.201951.6 kiB163 kiBFedora Project
Fedora iconFedora rawhide development/Everything-osrpm19.1.0-1.fc3120.03.201962 kiB216 kiBFedora Project
Manjaro iconManjaro rolling stable/extraxz19.1.0-130.03.201949.1 kiB305 kiB
Manjaro iconManjaro rolling testing/extraxz19.1.0-123.03.201949.1 kiB305 kiB
Manjaro iconManjaro rolling unstable/extraxz19.1.0-115.03.201949.1 kiB305 kiB
OpenSUSE iconOpenSUSE Leap 15.0 ossrpm17.4.0-lp150.1.317.01.201962.1 kiB166 kiBhttps://bugs.opensuse.org
OpenSUSE iconOpenSUSE Leap 15.1 ossrpm17.4.0-lp151.2.420.03.201962.1 kiB179 kiBhttps://bugs.opensuse.org
OpenSUSE iconOpenSUSE Tumbleweed ossrpm19.1.0-1.111.03.201979.6 kiB242 kiBhttps://bugs.opensuse.org

Latest updates

Manjaro rolling icon

Manjaro rolling stable/extra: Updated from 18.2.0-1 to 19.1.0-1

30.03.2019 01:04
Manjaro rolling icon

Manjaro rolling testing/extra: Updated from 18.2.0-1 to 19.1.0-1

23.03.2019 06:44
OpenSUSE Leap 15.1 icon

OpenSUSE Leap 15.1 oss: Updated from 17.4.0-lp151.2.2 to 17.4.0-lp151.2.4

20.03.2019 19:49
  • specfile:
    • update copyright year
  • update to version 17.4.0:
    • Backward-incompatible Changes
      • The traversal of MROs when using multiple inheritance was
      backward:
      If you defined a class "C" that subclasses "A" and "B" like "C(A, B)", "attrs" would have collected the attributes from "B"
    • before* those of "A".
      This is now fixed and means that in classes that employ multiple inheritance, the output of "__repr__" and the order of positional arguments in "__init__" changes.
      Due to the nature of this bug, a proper deprecation cycle was unfortunately impossible.
      Generally speaking, it's advisable to prefer "kwargs"-based initialization anyways ? *especially* if you employ multiple inheritance and diamond-shaped hierarchies.
      • The "__repr__" set by "attrs" no longer produces an
      "AttributeError" when the instance is missing some of the specified attributes (either through deleting or after using "init=False" on some attributes).
      This can break code that relied on "repr(attr_cls_instance)" raising "AttributeError" to check if any attr-specified members were unset.
      If you were using this, you can implement a custom method for checking this::
      def has_unset_members(self):
      for field in attr.fields(type(self)):
      try:
      getattr(self, field.name)
      except AttributeError:
      return True
      return False
    • Deprecations
      • The "attr.ib(convert=callable)" option is now deprecated in
      favor of "attr.ib(converter=callable)".
      This is done to achieve consistency with other noun-based arguments like *validator*. *convert* will keep working until at least January 2019 while raising a "DeprecationWarning".
    • Changes
      • Generated "__hash__" methods now hash the class type along with
      the attribute values. Until now the hashes of two classes with the same values were identical which was a bug.
      The generated method is also *much* faster now.
      • "attr.ib"?s "metadata" argument now defaults to a unique empty
      "dict" instance instead of sharing a common empty "dict" for all. The singleton empty "dict" is still enforced.
      • "ctypes" is optional now however if it's missing, a bare
      "super()" will not work in slots classes. This should only happen in special environments like Google App Engine.
      • The attribute redefinition feature introduced in 17.3.0 now
      takes into account if an attribute is redefined via multiple inheritance. In that case, the definition that is closer to the base of the class hierarchy wins.
      • Subclasses of "auto_attribs=True" can be empty now.
      • Equality tests are *much* faster now.
      • All generated methods now have correct "__module__", "__name__",
      and (on Python 3) "__qualname__" attributes.
Fedora rawhide icon

Fedora rawhide development/Everything-os: Updated from 18.2.0-1.fc31 to 19.1.0-1.fc31

20.03.2019 14:32
  • Updated to latest upstream.
Arch rolling icon

Arch rolling testing/os: Version 19.1.0-1 removed

15.03.2019 06:24
Arch rolling icon

Arch rolling extra/os: Updated from 18.2.0-1 to 19.1.0-1

15.03.2019 06:23
Manjaro rolling icon

Manjaro rolling unstable/extra: Updated from 18.2.0-1 to 19.1.0-1

15.03.2019 06:16
OpenSUSE Tumbleweed icon

OpenSUSE Tumbleweed oss: Updated from 18.2.0-2.2 to 19.1.0-1.1

11.03.2019 10:13
  • update to 19.1.0
    • Fixed a bug where deserialized objects with cache_hash=True could have incorrect hash code values
    • Add is_callable, deep_iterable, and deep_mapping validators.
    • Fixed stub files to prevent errors raised by mypy's disallow_any_generics = True option.
    • Attributes with init=False now can follow after kw_only=True attributes.
    • attrs now has first class support for defining exception classes.
    • Clarified documentation for hashing to warn that hashable objects should be deeply immutable
Fedora rawhide icon

Fedora rawhide development/Everything-os: Updated from 17.4.0-8.fc30 to 18.2.0-1.fc31

10.03.2019 09:33
  • Updated to latest upstream.
Arch rolling icon

Arch rolling testing/os: Version 19.1.0-1 introduced

04.03.2019 16:06
Fedora rawhide icon

Fedora rawhide development/Everything-os: Updated from 17.4.0-7.fc29 to 17.4.0-8.fc30

12.02.2019 04:53
OpenSUSE Tumbleweed icon

OpenSUSE Tumbleweed oss: Updated from 18.2.0-2.1 to 18.2.0-2.2

03.02.2019 10:24
  • Fix fdupes call
OpenSUSE Tumbleweed icon

OpenSUSE Tumbleweed oss: Version 18.2.0-2.1 reintroduced

23.01.2019 18:32
  • Fix fdupes call
OpenSUSE Leap 15.1 icon

OpenSUSE Leap 15.1 oss: Version 17.4.0-lp151.2.2 introduced

23.01.2019 10:09
  • specfile:
    • update copyright year
  • update to version 17.4.0:
    • Backward-incompatible Changes
      • The traversal of MROs when using multiple inheritance was
      backward:
      If you defined a class "C" that subclasses "A" and "B" like "C(A, B)", "attrs" would have collected the attributes from "B"
    • before* those of "A".
      This is now fixed and means that in classes that employ multiple inheritance, the output of "__repr__" and the order of positional arguments in "__init__" changes.
      Due to the nature of this bug, a proper deprecation cycle was unfortunately impossible.
      Generally speaking, it's advisable to prefer "kwargs"-based initialization anyways ? *especially* if you employ multiple inheritance and diamond-shaped hierarchies.
      • The "__repr__" set by "attrs" no longer produces an
      "AttributeError" when the instance is missing some of the specified attributes (either through deleting or after using "init=False" on some attributes).
      This can break code that relied on "repr(attr_cls_instance)" raising "AttributeError" to check if any attr-specified members were unset.
      If you were using this, you can implement a custom method for checking this::
      def has_unset_members(self):
      for field in attr.fields(type(self)):
      try:
      getattr(self, field.name)
      except AttributeError:
      return True
      return False
    • Deprecations
      • The "attr.ib(convert=callable)" option is now deprecated in
      favor of "attr.ib(converter=callable)".
      This is done to achieve consistency with other noun-based arguments like *validator*. *convert* will keep working until at least January 2019 while raising a "DeprecationWarning".
    • Changes
      • Generated "__hash__" methods now hash the class type along with
      the attribute values. Until now the hashes of two classes with the same values were identical which was a bug.
      The generated method is also *much* faster now.
      • "attr.ib"?s "metadata" argument now defaults to a unique empty
      "dict" instance instead of sharing a common empty "dict" for all. The singleton empty "dict" is still enforced.
      • "ctypes" is optional now however if it's missing, a bare
      "super()" will not work in slots classes. This should only happen in special environments like Google App Engine.
      • The attribute redefinition feature introduced in 17.3.0 now
      takes into account if an attribute is redefined via multiple inheritance. In that case, the definition that is closer to the base of the class hierarchy wins.
      • Subclasses of "auto_attribs=True" can be empty now.
      • Equality tests are *much* faster now.
      • All generated methods now have correct "__module__", "__name__",
      and (on Python 3) "__qualname__" attributes.
CentOS 7.6.1810 icon

CentOS 7.6.1810 cloud/openstack-rocky: Version 17.4.0-4.el7 introduced

23.01.2019 10:00
OpenSUSE Leap 15.0 icon

OpenSUSE Leap 15.0 oss: Version 17.4.0-lp150.1.3 introduced

17.01.2019 18:52
  • specfile:
    • update copyright year
  • update to version 17.4.0:
    • Backward-incompatible Changes
      • The traversal of MROs when using multiple inheritance was
      backward:
      If you defined a class "C" that subclasses "A" and "B" like "C(A, B)", "attrs" would have collected the attributes from "B"
    • before* those of "A".
      This is now fixed and means that in classes that employ multiple inheritance, the output of "__repr__" and the order of positional arguments in "__init__" changes.
      Due to the nature of this bug, a proper deprecation cycle was unfortunately impossible.
      Generally speaking, it's advisable to prefer "kwargs"-based initialization anyways ? *especially* if you employ multiple inheritance and diamond-shaped hierarchies.
      • The "__repr__" set by "attrs" no longer produces an
      "AttributeError" when the instance is missing some of the specified attributes (either through deleting or after using "init=False" on some attributes).
      This can break code that relied on "repr(attr_cls_instance)" raising "AttributeError" to check if any attr-specified members were unset.
      If you were using this, you can implement a custom method for checking this::
      def has_unset_members(self):
      for field in attr.fields(type(self)):
      try:
      getattr(self, field.name)
      except AttributeError:
      return True
      return False
    • Deprecations
      • The "attr.ib(convert=callable)" option is now deprecated in
      favor of "attr.ib(converter=callable)".
      This is done to achieve consistency with other noun-based arguments like *validator*. *convert* will keep working until at least January 2019 while raising a "DeprecationWarning".
    • Changes
      • Generated "__hash__" methods now hash the class type along with
      the attribute values. Until now the hashes of two classes with the same values were identical which was a bug.
      The generated method is also *much* faster now.
      • "attr.ib"?s "metadata" argument now defaults to a unique empty
      "dict" instance instead of sharing a common empty "dict" for all. The singleton empty "dict" is still enforced.
      • "ctypes" is optional now however if it's missing, a bare
      "super()" will not work in slots classes. This should only happen in special environments like Google App Engine.
      • The attribute redefinition feature introduced in 17.3.0 now
      takes into account if an attribute is redefined via multiple inheritance. In that case, the definition that is closer to the base of the class hierarchy wins.
      • Subclasses of "auto_attribs=True" can be empty now.
      • Equality tests are *much* faster now.
      • All generated methods now have correct "__module__", "__name__",
      and (on Python 3) "__qualname__" attributes.
OpenSUSE Tumbleweed icon

OpenSUSE Tumbleweed oss: Version 18.2.0-2.1 removed

17.01.2019 17:18
OpenSUSE Tumbleweed icon

OpenSUSE Tumbleweed oss: Version 18.2.0-2.1 introduced

17.01.2019 17:04
  • Fix fdupes call
Fedora rawhide icon

Fedora rawhide development/Everything-os: Version 17.4.0-7.fc29 reintroduced

16.01.2019 12:54
Fedora rawhide icon

Fedora rawhide development/Everything-os: Version 17.4.0-7.fc29 removed

15.01.2019 18:19

Related packages

python2 - An interpreted, interactive, object-oriented programming language
⇧ Top