Commit Graph

10 Commits

Author SHA1 Message Date
Alex Ford 123df67041 Added support for keyword-only arguments on Python 3+ [rebase] (#411)
* Added support for keyword-only attributes. Closes #106, and closes #38

(Rebases #281)

Co-authored-by: Alex Ford <fordas@uw.edu>

* Add `attr.s`-level `kw_only` flag.

Add `kw_only` flag to `attr.s` decorator, indicating that all class
attributes should be keyword-only in __init__.

Minor updates to internal interface of `Attribute` to support
evolution of attributes to `kw_only` in class factory.

Expand examples with `attr.s` level kw_only.

* Add `kw_only` to type stubs.

* Update changelog for rebased PR.

Hear ye, hear ye. A duplicate PR is born.

* Tidy docs from review.

* Tidy code from review.

* Add explicit tests of PY2 kw_only SyntaxError behavior.

* Add `PythonToOldError`, raise for kw_only on PY2.

* `Attribute._evolve` to `Attribute._assoc`.
2018-08-11 06:40:01 +02:00
Hynek Schlawack bc0b437e58
Rename convert to converter (#315) 2017-12-23 08:46:10 +01:00
Hynek Schlawack 3d3d49b4dd Prepare for narrative docs (#275) 2017-10-26 17:55:45 +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 f560500886 Fix hashing behavior (#142) 2017-02-19 09:51:43 +01:00
Tin Tvrtković 0fac9215b8 Introduce attribute metadata. (#96) 2016-11-19 09:47:03 +01:00
Hynek Schlawack 07366e18c1 Rename cl to cls 2016-08-15 15:59:10 +02:00
Hynek Schlawack 89b542331d Drop support for legacy Python versions
Keep 2.7 and PyPy though.
2016-02-17 12:51:02 +01:00
Christopher Armstrong 20357d4368 fix doctests and lint 2015-11-19 13:59:25 +01:00
Hynek Schlawack 27e2f4e5c0 Document how to extend attrs 2015-03-23 10:32:13 +01:00