You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The order of attributes that are passed into attr.make_class() or
the these argument of @attr.s() is now retained if the
dictionary is ordered (i.e. dict on Python 3.6 and later, collections.OrderedDict otherwise).
Before, the order was always determined by the order in which the
attributes have been defined which may not be desirable when
creating classes programatically.
We have restructured the documentation a bit to account for attrs' growth in scope. Instead of putting everything into the examples page, we
have started to extract narrative chapters.
It's the spiritual successor of characteristic and aspires to
fix some of it clunkiness and unfortunate decisions. Both were inspired
by Twisted's FancyEqMixin
but both are implemented using class decorators because sub-classing is
bad for you, m'kay?
The text was updated successfully, but these errors were encountered:
There are new versions of attrs available from pypi.
18.1.0
Changes
x=X(); x.cycle = x; repr(x)
will no longer raise aRecursionError
, and will instead show asX(x=...)
.#95
attr.ib(factory=f)
is now syntactic sugar for the common case ofattr.ib(default=attr.Factory(f))
.#178,
#356
Added
attr.field_dict()
to return an ordered dictionary ofattrs
attributes for a class, whose keys are the attribute names.
#290,
#349
The order of attributes that are passed into
attr.make_class()
orthe
these
argument of@attr.s()
is now retained if thedictionary is ordered (i.e.
dict
on Python 3.6 and later,collections.OrderedDict
otherwise).Before, the order was always determined by the order in which the
attributes have been defined which may not be desirable when
creating classes programatically.
#300,
#339,
#343
In slotted classes,
__getstate__
and__setstate__
now ignore the__weakref__
attribute.#311,
#326
Setting the cell type is now completely best effort. This fixes
attrs
on Jython.We cannot make any guarantees regarding Jython though, because our
test suite cannot run due to dependency incompatabilities.
#321,
#334
If
attr.s
is passed a these argument, it will not attempt toremove attributes with the same name from the class body anymore.
#322,
#323
The hash of
attr.NOTHING
is now vegan and faster on 32bit Pythonbuilds.
#331,
#332
The overhead of instantiating frozen dict classes is virtually
eliminated.
#336
Generated
__init__
methods now have an__annotations__
attributederived from the types of the fields.
#363
We have restructured the documentation a bit to account for
attrs
' growth in scope. Instead of putting everything into theexamples page, we
have started to extract narrative chapters.
So far, we've added chapters on
initialization and
hashing.
Expect more to come!
#369,
#370
Full changelog.
Credits
attrs
is written and maintained by HynekSchlawack.
The development is kindly supported by Variomedia
AG.
A full list of contributors can be found in GitHub's
overview.
It's the spiritual successor of
characteristic and aspires to
fix some of it clunkiness and unfortunate decisions. Both were inspired
by Twisted's
FancyEqMixin
but both are implemented using class decorators because sub-classing is
bad for you, m'kay?
The text was updated successfully, but these errors were encountered: