Commit Graph

78 Commits

Author SHA1 Message Date
Hynek Schlawack 3040bdabbc Refactor class creation (#272)
Instead of adding and possibly later deleting attributes, the class creation is delegated into a cleaner building pattern.
2017-10-26 12:55:34 +02:00
Hynek Schlawack 37a421e559 Remove empty headers 2017-08-20 08:36:55 +02:00
Hynek Schlawack cce7ff2ace Add another explanation and warning to the changelog 2017-08-20 08:35:12 +02:00
Hynek Schlawack 622d6adf97 Explain location of news fragments in CHANGELOG.rst 2017-08-20 08:05:07 +02:00
Hynek Schlawack 55ae1945b3 Move changelog to towncrier (#236) 2017-08-20 07:58:08 +02:00
Tin Tvrtković 47583a9459 Bugfix/slot super (#226) 2017-08-03 17:04:48 +02:00
Hynek Schlawack 24815d7a78 Make Factory hashable (#204)
* Make Factory hashable

* Add PR#
2017-06-06 13:13:41 +02:00
Andy Freeland a6cf2d5637 Fix unbound __str__ on Python 2 when slots=True (#199)
Previously:

```pycon
>>> import attr
>>> @attr.s(str=True, slots=True)
... class A(object):
...     a = attr.ib()
...
>>> a = A(1)
>>> str(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unbound method repr_() must be called with A instance as first argument (got nothing instead)
```

Fixes #198.
2017-06-01 09:30:31 +02:00
Hynek Schlawack dc5253a061 Start new release cycle 2017-05-24 11:04:18 -07:00
Hynek Schlawack c324a7d547 Prepare 17.2.0 2017-05-24 10:57:35 -07:00
Tin Tvrtković 82ea73cb47 Compatibility fixes. (#193)
* Restore hash to validators.

* Restore Attribute.default and Attribute.validator.

* _AndValidator is hashable now. Test validator hashability.

* Add in_ to validators.__all__.
2017-05-19 11:31:00 -07:00
Hynek Schlawack 616f24491d Add missing PR# 2017-05-16 20:08:35 +02:00
Hynek Schlawack edf75f2e77 Start new release cycle 2017-05-16 19:04:29 +02:00
Hynek Schlawack f094aec6a9 Prepare 17.1.0 2017-05-16 18:56:14 +02:00
Hynek Schlawack b90f9a545a Add a sterner warning to changelog 2017-05-16 18:41:38 +02:00
Hynek Schlawack 10b911fbb4 Fix typo 2017-05-16 18:27:07 +02:00
Andre Dieb 461e1b2aab [RFC] Enhancement/one of validator (#181) 2017-05-16 10:36:42 +02:00
Hynek Schlawack a328e67169 Add takes_self to Factory and @_CountingAttr.default (#189)
* Add takes_self to Factory and @_CountingAttr.default

Fixes #165

* Add dark @Tinche magic
2017-05-16 09:36:39 +02:00
Hynek Schlawack fbe0bd5967 Make optional support lists of validators (#186) 2017-05-12 23:02:07 +02:00
Timothy Emiola fdfd51e249 Allow optional conversion (#173)
Fixes #105
2017-05-10 15:37:50 +02:00
Hynek Schlawack beca344034 Use our domain 2017-04-27 16:44:58 +02:00
Hynek Schlawack d8f333f6f2 Fix a bunch of links 2017-03-24 10:28:28 +01:00
Hynek Schlawack 8827b718bc Add changelog entry for #155 2017-03-07 15:10:23 +01:00
Hynek Schlawack a098b2ca82 Tuned changelog
Remove requirement for present tense in changelog.  A changelog is not a git
history and reads weird.
2017-03-04 08:25:59 +01:00
Adam Morris d86e28bdde Add bases argument to make_class (#152)
Fixes #152
2017-03-04 07:40:50 +01:00
Hynek Schlawack 74c2a1f91d Fix links 2017-02-20 07:46:55 +01:00
Hynek Schlawack f560500886 Fix hashing behavior (#142) 2017-02-19 09:51:43 +01:00
Hynek Schlawack ac461ff155 fix double changes 2017-02-18 07:32:56 +01:00
Hynek Schlawack 0563f44b47 Move doc theme to alabaster
Reason is that the RTD theme looks weird for multi-paragraph parameter API
docs.
2017-02-12 08:48:35 +01:00
Hynek Schlawack 97a02470e8 Fix inheritence of frozen-ness
Fixes #128
2017-02-12 08:33:20 +01:00
Hynek Schlawack 37d38c4dc3 Allow inline definitions of validators using a decorator
Also make previous changes for multiple validators backward-compatible.
2017-02-11 16:56:56 +01:00
Hynek Schlawack 72363a2a09 Allow validator to be a list of validators
Fixes #138
2017-02-04 14:38:05 +01:00
Hynek Schlawack 14556429b5 Fix changelog 2017-02-03 13:05:42 +01:00
Tin Tvrtković 0d3cf3f624 Evolve and docs. (#135)
assoc is now deprecated in favor of evolve.
2017-01-21 17:11:45 +01:00
Eugene Pakhomov 1481227583 Fix post init hook not being called if validators are disabled (#129) (#130)
Fixes #129
2017-01-06 15:08:17 +01:00
Hynek Schlawack 4894377846 Fix changelog 2016-12-14 10:57:32 +01:00
Thomas A Caswell 72743d2b32 ENH: forbid delete attr from frozen class (#118)
Raise FrozenInstanceError when trying to delete an attribute from
a frozen class.
2016-12-14 10:55:43 +01:00
Hynek Schlawack df0800d771 Start new release cycle 2016-11-24 14:07:12 +01:00
Hynek Schlawack 5516d5452c Prepare 16.3.0 2016-11-24 14:01:14 +01:00
Hynek Schlawack b0942e1b2e Add str argument to @attr.s
Fixes #112
2016-11-20 15:52:11 +01:00
Hynek Schlawack 3964f9d37b Rename __post_init__ to __attrs_post_init__
This makes it clearer its coming from attrs and is consistent with
__attrs__attrs__.
2016-11-20 14:39:34 +01:00
Hynek Schlawack 7e4cecdac2 Minor tweaks 2016-11-20 14:30:29 +01:00
Tommy Beadle 3dc5fb0a5a Add ability for ``__post_init__`` method to be defined.
If this method is defined for a class, it will get executed at the end
of ``__init__``.  Previously, there was no way to extend what was
done during ``__init__`` when using ``@attr.s``.
2016-11-20 14:05:34 +01:00
Tin Tvrtković 0fac9215b8 Introduce attribute metadata. (#96) 2016-11-19 09:47:03 +01:00
Roger Pate 4849dc12de don't overwrite __name__ with __qualname__ (#100) 2016-09-30 15:48:31 +02:00
Hynek Schlawack 33607a7895 Start new release cycle 2016-09-17 08:00:44 +02:00
Hynek Schlawack cc980c1f53 Prepare 16.2.0 2016-09-17 07:49:51 +02:00
inso 1b419e304b Add attr.astuple
Fixes #77 and fixes #78
2016-09-11 08:55:30 +02:00
Hynek Schlawack 62cb2e7347 Document new method of accessing attributes 2016-09-10 19:55:27 +02:00
Tin Tvrtković 1897dfdf19 Improve tests, bandage assoc
Refactored and documented the simple_classes strategy. Applied the strategy to
assoc tests.
2016-09-10 08:40:47 +02:00