Changelog¶
5.0.0 (2016-04-13)¶
Added the
fields.InheritableFields
base. It allows subclassing and it’s intended for multiple inheritance scenarios. Yes, yes, this enables lots pain and suffering, but some people just like it that way.Simplified the interfaces for the builtin sealers (the required argument is gone as it was redundant, and the remaining arguments are swapped). Now they must be a function that take just two arguments:
fields, defaults
.
4.0.0 (2016-01-28)¶
Added
__all__
andfactory
conveniences. Removedfields.Factory
from the public API since it need some special care with it’s use (it’s a damn metaclass after all).Added
make_init_func
into public API for advanced uses (combine withfactory
andclass_sealer
).
3.0.0 (2015-10-04)¶
Disallowed creating containers with fields with “dunder” names. E.g.:
class Foo(Fields.__foo__):
is disallowed.
2.4.0 (2015-06-13)¶
Similarly to
fields.Fields
, added three new bases:fields.BareFields
(implements__init__
).fields.ComparableMixin
(implements__eq__
,__ne__
,__lt__
,__gt__
,__le__
,__ge__
and__hash__
).fields.PrintableMixin
(implements__repr__
).
Improved reference section in the docs.
Added
fields.ConvertibleFields
andfields.ConvertibleMixin
. They have two convenience properties:as_dict
and as_tuple`.
2.3.0 (2015-01-20)¶
Allowed overriding
__slots__
inSlotsFields
subclasses.
2.2.0 (2015-01-19)¶
Added
make_init_func
as an optional argument toclass_sealer
. Rename the__base__
option to justbase
.
2.1.1 (2015-01-19)¶
Removed bogus
console_scripts
entrypoint.
2.1.0 (2015-01-09)¶
Added
SlotsFields
(same asFields
but automatically adds__slots__
for memory efficiency on CPython).Added support for default argument to Tuple.
2.0.0 (2014-10-16)¶
Made the __init__ in the FieldsBase way faster (used for
fields.Fields
).Moved
RegexValidate
infields.extras
.
1.0.0 (2014-10-05)¶
Lots of internal changes, the metaclass is not created in a closure anymore. No more closures.
Added
RegexValidate
container creator (should be taken as an example on using the Factory metaclass).Added support for using multiple containers as baseclasses.
Added a
super()
sink so thatsuper().__init__(*args, **kwargs)
always works. Everything inherits from a baseclass that has an__init__
that can take any argument (unlikeobject.__init__
). This allows for flexible usage.Added validation so that you can’t use conflicting field layout when using multiple containers as the baseclass.
Changed the __init__ function in the class container so it works like a python function w.r.t. positional and keyword arguments. Example:
class MyContainer(Fields.a.b.c[1].d[2])
will function the same way asdef func(a, b, c=1, d=2)
would when arguments are passed in. You can now useMyContainer(1, 2, 3, 4)
(everything positional) orMyContainer(1, 2, 3, d=4)
(mixed).
0.3.0 (2014-07-19)¶
Corrected string repr.
0.2.0 (2014-06-28)¶
Lots of breaking changes. Switched from __call__ to __getitem__ for default value assignment.
0.1.0 (2014-06-27)¶
Alpha release.