attrs v16.1.0 Release Notes

Release Date: 2016-08-30 // over 7 years ago
  • Backward-incompatible Changes:

    • All instances where function arguments were called cl have been changed to the more Pythonic cls. Since it was always the first argument, it's doubtful anyone ever called those function with in the keyword form. If so, sorry for any breakage but there's no practical deprecation path to solve this ugly wart.

    ๐Ÿ—„ Deprecations: ^

    • ๐Ÿ—„ Accessing Attribute instances on class objects is now deprecated and will stop working in 2017. If you need introspection please use the __attrs_attrs__ attribute or the attr.fields() function that carry them too. In the future, the attributes that are defined on the class body and are usually overwritten in your __init__ method are simply removed after @attr.s has been applied.

    This will remove the confusing error message if you write your own __init__ and forget to initialize some attribute. Instead you will get a straightforward AttributeError. In other words: decorated classes will work more like plain Python classes which was always attrs's goal.

    • ๐Ÿ—„ The serious business aliases attr.attributes and attr.attr have been deprecated in favor of attr.attrs and attr.attrib which are much more consistent and frankly obvious in hindsight. They will be purged from documentation immediately but there are no plans to actually remove them.

    ๐Ÿ”„ Changes: ^

    • attr.asdict()\ 's dict_factory arguments is now propagated on recursion. #45 <https://github.com/python-attrs/attrs/issues/45>_
    • attr.asdict(), attr.has() and attr.fields() are significantly faster. #48 <https://github.com/python-attrs/attrs/issues/48>_ #51 <https://github.com/python-attrs/attrs/issues/51>_
    • โž• Add attr.attrs and attr.attrib as a more consistent aliases for attr.s and attr.ib.
    • Add frozen option to attr.s that will make instances best-effort immutable. #60 <https://github.com/python-attrs/attrs/issues/60>_
    • attr.asdict() now takes retain_collection_types as an argument. If True, it does not convert attributes of type tuple or set to list. #69 <https://github.com/python-attrs/attrs/issues/69>_