* Added kw_only support for py2
* Docs update
* Added changelog
* Better exception message, moved code to function
* Moved py2-only functions under if PY2:
* Tested fancy error message for unexpected kw-only argument
* Tested fancy error message for unexpected kw-only argument
* Fixed line length
* Added versionchanged
* Updated docs
* Moved functions back under if PY2 - seems codecov doesn't like them in module scope
* Blacked
* Fixed changelog.d
* Removed redundant brackets in test
* Added assertion to the _unpack_kw_only_lines_py2 - hope it will increase code coverage
* List comprehension -> for loop
* lines.extend? I do not like for-loops
* Fix code
* Fixed style/added comment
* Fixed docs (removed python2 mention)
* Fix lint
* Better docstring
* Rewritten docstring and added example code
* Added quotes
Co-authored-by: Hynek Schlawack <hs@ox.cx>
* Add attr.auto/mutable/frozen
Prepare for import attrs y'all!
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Try combining coverage using 3.8, always
* Add tests for overriding of auto_attribs
* Clarifications
* Add newsfragment
* s/auto/define
This is going be the next-gen name anyways, so no need to introduce new names.
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Missed two
* Add type stubs
* Beg for patience
* Explain second setup-python action
* fix comment
* 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>
* Add on_setattr hooks to attr.s and attr.ib
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Add PR newsfragment
* Fix attr.s doc sig
* Make _DisableType private
* Mark setters.frozen as NoReturn
* Rename setters.DISABLE to setters.NO_OP to clarify its purpose
DISABLE sounds less purposeful and doesn't convey its meaning as well.
* Fix type
* Loosen up type for convert even further
* Tighten type a tiny bit
* Add control to generate __[sg]etstate__
Pass *getstate_setstate* to attr.s to control the generation. Mostly
interesting for disabling it in slotted classes.
Fixes #512,#513
* Update glossary.rst
* Implement auto_detect
Fixes#324
* Add test demonstrating total_ordering
* Ensure the order of applying total_ordering does not matter
* Warn if a method is missing
* Revert "Warn if a method is missing"
This reverts commit 590ef43458040e0a1b9f3644ba22b4229f7d6990.
* Add stern warning that nobody will read
* Mention attr.fields() after __attrs_attrs__ in 'How does it work'
The mentioning of __attrs_attrs__ in a 'how does it work' document makes sense but it seems important to mention that there are good non-dunder ways to access the data.
* Correct how-does-it-work.rst change to use semantic newlines
* it's attr not attrs...
* Simplify attr.fields link
* Split cmp into eq and order
Fixes#170
* Fix tests on old pypy3 versions
Old as in: currently on AP.
* Fix issue number and clarify newsfragment
* Clarify behavior and interaction between cmp/eq/order
* This sounds better
* Address Julian's review comments
* Missed a cmp
* Test the behavior of Attribute.cmp
* Make test more idiomatic
* Explain assumptions
* Clarify comment
* Grammar
* One more cmp!
* Add default_role for Sphinx.
Fix a bunch of broken refs along the way, which become
errors now via -W if you have default_role set.
In theory you can catch those via sphinx-build -n (i.e.
nitpick mode), which IMHO is a decent idea anyhow, but it's
a longer diff to enable that because it'd involve fixing a
bunch of the places that try to reference types that don't
exist (e.g. :type foo: Any value). But obviously can be done.
Also didn't actually use this anywhere yet (the any role),
but will do so in a follow-up if this is acceptable.
* Remove the roles from builtin objects to demo any.
* Style.
* Add z.i to intersphinx.
Enables the link to z.i.Interface.
* Enable nitpick mode.
Fix the remaining broken links or whitelist them via nitpick_ignore.
* Kill all :func:s.
* Kill all :class:es.
* Kill all :doc:s.
* Kill all :ref:s.
Except one, that probably meant :func:, and which
is a duplicate ref.
* Kill :exc: and :data:.
* Kill :mod:s.
* Kill new explicit refs from the merge.
* matches
* added flags pass-through, and multiple function options; defaults to fullmatch
* move logic from validate to constructor
* cleaned up default args / fullmatch emulation
* fixed meta validator
* cleaned up default args / fullmatch emulation
* test cleanup
* versionadded tag
* added changelog entry
* cleaned up type checks, added to api docs and pyi type signature
* black formats
* black formatting
* 100% test coverage
* added example usage of matches_re to docs
* fixing py2 swallow type error and wrong quote in doctest
* explicit tests for all possible func args
* pragma no branch to get coverage 100%
* wip: support custom repr() callable for attributes
see #567
* extend ‘repr=...’ arg type in .pyi stubs
* expand docstring for attr.ib()
* add changelog entry
* add docs with example
* improve my copy/paste skills 🙈
* fix grammar
* fix typo in changelog entry
* fix and improve attrib() docstring
* detect custom repr() once, not per call. be strict about bool.
* use rst syntax, not markdown
* apply hynek's suggestions for changelog entry
* add ‘versionchanged’ note in docstring
* add custom attribute repr= to typing example
* simplify comment
The documentation already explains well why validator or default decorated methods
must not have the name of existing attributes (because they would be overridden).
This replaces the last remaining examples not using the explicit explanatory name.