* Add attr.resolve_types
This adds `attr.resolve_types` which can be used to resolve forward declarations in classes created using `__annotations__`
Fixes#265
* Fix flake8 and doctest
* Missed one
* Fix lint
* Address CR comments
Add to stubs
Make it a decorator, because why not?
* Fix test
* Rerun-tests please
* Rerun-tests please
* Fix another
* Fix lint
Co-authored-by: David Euresti <david@zapgram.com>
* 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`.
* Support `from typing import ClassVar`
Also updated the docstring to reflect why exactly we're doing what we're doing.
The previous comment was incorrect (`typing` is already imported in
applications using annotations).
I added `t.ClassVar` as well which is the only third alternative import I found
in use for typing-related classes.
Fixes#361
* Tests, docstrings, et al.
* 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
* 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.