Commit Graph

177 Commits

Author SHA1 Message Date
Hynek Schlawack 7a242a1bf8 Mark error in example 2018-05-01 12:18:26 +02:00
Pavel Karateev 7a80d57d1c Fix typo: double "be" (#373) 2018-04-26 19:14:15 +02:00
Hynek Schlawack 879f43d355 Add narrative chapter about initialization (#370)
* Add narrative chapter on initialization

* Be more explicit about defining validators both ways

* Stress that the name of default/validator != attr name

* Mention nested schemas

* Explain handling of private attributes

* Add another consequence of _ stripping

* Stress that nothing should overwrite attributes on class body

* Better wording

* typo

* Dedup examples

* Address review feedback

* Add newsfragments
2018-04-25 00:07:03 +02:00
Hynek Schlawack 57817b2c0e
Add a narrative chapter on object hashing (#369)
* Add a narrative chapter on object hashing

* Simplify

* Add a "what to do" to the tl;dr warning

* Shuffle around

* Fix typos
2018-04-16 07:49:34 +02:00
David Euresti fc033b41a1 Annotate __init__ with type hints (#363)
* Annotate __init__ with type hints

This just adds the annotations found at run-time to the
`__annotations__` attribute of the created `__init__` function

Fixes #249

* More tests. Add return annotation

* Documentation

* This is not markdown
2018-04-06 10:36:29 +02:00
Hynek Schlawack 780e1e5e1e
Add syntactic sugar for attr.ib(default=attr.Factory) (#356)
Fixes #178
2018-03-14 19:05:48 +01:00
Michael Boger 16e65835f4 "fits_byte" validator should allow 0 (#355)
bytes are in the range 0..255, not 1...255.
2018-03-14 16:57:12 +01:00
Andy Freeland bf65b96a91 Add attr.fields_dict() (#349) 2018-03-03 15:09:05 +01:00
Hynek Schlawack eca48ca7f3
Explain our position on Data Classes (#337) 2018-01-29 15:12:05 +01:00
Hynek Schlawack 13fd7403cb Update How Does It Work 2018-01-29 08:03:31 +01:00
Hynek Schlawack 75cdf8fe91 Add missing argument to signature
Fixes #333
2018-01-26 12:05:49 +01:00
Hynek Schlawack 1357de7471 Make example __hash__ closer to reality
Fixes #327
2018-01-18 11:23:29 +01:00
Hynek Schlawack 9af773bdf3 Better wording 2018-01-16 14:04:32 +01:00
Hynek Schlawack ea99d26666 Clean up main directory a bit 2017-12-27 13:32:32 +01:00
Hynek Schlawack bc0b437e58
Rename convert to converter (#315) 2017-12-23 08:46:10 +01:00
Hynek Schlawack 5ed8c4a015
Fix MRO traversal with multiple inheritance (#304)
* Fix MRO traversal with multiple inheritance

* Add newsfragments
2017-12-13 15:33:44 +01:00
Hynek Schlawack 7501cecf0f m(
fixes #283
2017-11-08 19:21:26 +01:00
Hynek Schlawack aa501176fa Better line wrap of example 2017-11-08 17:24:01 +01:00
Hynek Schlawack 0d2cd55ccd Nicer heading 2017-11-08 17:23:56 +01:00
Hynek Schlawack c5caba6050 Tune font stack 2017-11-08 16:38:47 +01:00
Hynek Schlawack 88aa1c897d
Add auto_attribs (#277)
Allow for attr.ib-less attribute definitions using class variable annotations.
2017-11-08 11:15:21 +01:00
Hynek Schlawack 2a50c4b930 Get rid of serif pretentiosness
And some doc polish
2017-11-08 07:11:10 +01:00
Stanis Trendelenburg c1adf5cfc6 Fix pickling for instances of classes created using make_class() (#282) 2017-11-04 14:38:03 +01:00
Hynek Schlawack 1bb8fbd5ef Add and use SVG version of our logo 2017-11-01 14:28:52 +01:00
Hynek Schlawack 3d3d49b4dd Prepare for narrative docs (#275) 2017-10-26 17:55:45 +02:00
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 8b490b8586 Stop setting attributes on class bodies (#253)
* Stop setting attributes on class bodies

This behavior has been deprecated since 16.1 and can now be removed in
accordance with our backward-compatibility policy.

* We don't need iterkeys anymore
2017-10-02 12:14:37 +02:00
Ned Batchelder ba9e8bcd24 Tweak the English. (#246) 2017-09-18 14:55:39 +02:00
Chad Dombrova 566ada9848 Basic type support (#239)
* Add support for passing a type to attr.ib() and gathering the type from PEP526-style annotations.

* Address review notes.

* More review notes.

* A few more review changes.

* Quick final fix to the changelog.
2017-09-17 16:22:49 +02:00
Hynek Schlawack 0d04d5e7fc Consistency 2017-08-21 11:20:50 +02:00
Hynek Schlawack d08753d2e1 Stress that attrs doesn't take away control 2017-08-21 10:29:42 +02:00
Hynek Schlawack 26a8c8c7b3 Expand notes on namedtuples (#237) 2017-08-21 10:25:29 +02:00
Hynek Schlawack e31cbe5cfd Add more docs about __attrs_post_init__ (#235)
* Add more docs about __attrs_post_init__

* Grammer
2017-08-18 20:43:38 +02:00
Hynek Schlawack c637f5b4f8 Wordsmith how does it work 2017-08-18 17:19:11 +02:00
rtoijala 10368b4232 Some more typos (#219)
I went with the American spelling of "fulfill" instead of the British
"fulfil".
2017-07-20 17:30:20 +02:00
egregius313 1c0549ce27 Fix typo in example error message (#206)
The error message on line 311 said "y must be... when it was supposed to be "x must be...
2017-06-07 06:22:44 +02:00
George Macon 4db1f4ef17 Document weakref to slot class (#197)
This adds a paragraph to the documentation that includes the method
described by @Tinche in #174 for making a slot class weak-referenceable.
2017-05-31 20:42:31 +02:00
Hynek Schlawack ca34d804e9 Make theme less agist 2017-05-23 16:11:37 -07:00
Hynek Schlawack 26c166e08b Rip out characteristic bits
Nobody knows about it anymore.
2017-05-22 17:32:39 -07:00
Hynek Schlawack 04e171aa4c Document validator syntax more prominently 2017-05-22 16:42:40 -07:00
Hynek Schlawack 8ed593b954 Better way to fix evolve docs 2017-05-22 16:23:18 -07:00
Hynek Schlawack b7919d0ddd Fix doc build on sphinx 1.6.1 2017-05-22 16:16:12 -07: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 d02b1d8b5a Decouple `these` docs from properties
Fixes #177
2017-05-10 09:17:43 +02:00
Simon Willison dcba01db6b in the form "of", not "on" (#184) 2017-05-10 06:11:16 +02:00
Tin Tvrtković b79a49e9a4 Fix evolve (cont) (#182) 2017-05-04 13:20:39 +02:00
Hynek Schlawack b6ead28967 Remove ableist slur 2017-04-20 14:59:33 +02:00