* converters: allow wrapping & takes_self
* Add takes field
* Add news fragment
* Refactor name and call creation
* Make argument names more idiomatic
* Add missing hints
* Make 3-arg converters zero-overhead at runtime
* Remove unnecessary changes
* More idiomatic name
* Explain method
* Make pickle test more meaningful
* Add unit tests for fmt_converter_call
* Check our eq works too
* Convert Converter docstring to Napoleon
* Fix rebase fubar
* Add ~types~
* Comment out failing mypy tests for now
* Fix mypy tests
* Add warning
* Add narrative docs
* Fix converter overloads, add tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Some error messages changed in mypy 1.7.0 and pyright 1.1.335.
Also, test_mypy sometimes fails with xdist (-n auto). A failure I can
reliably reproduce locally is due to changes in type variables numbering.
There may be other issues.
* Add AttrsInstance protocol to forgotten attrs.asdict and attrs.astuple
* Add mypy test for attrs.asdict
* Add changelog entry for attrs.asdict
* Clarify it's about type stubs
Co-authored-by: Hynek Schlawack <hs@ox.cx>
* Use `TypeGuard` for `has` in Python 3.10 and above
* fixup! Use `TypeGuard` for `has` in Python 3.10 and above
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Test the negative case
* Add type guard example
Co-authored-by: Hynek Schlawack <hs@ox.cx>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Drop Python 2.7
The tooling situation around Python 2 has deteriorate to such a degree that
upholding compatibility is not tenable anymore for a volunteer-run project.
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Add newsfragment
* Run Python 3.5 under coverage to make up for Python 2.7
* Wait for py35 in parallel
* Remove fullmatch kludge
* Remove Python 2-specific code
* Revert empty slot test
Also disable pyupgrade on that file.
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* We DO run under 3.5
* Remove __qualname__ workarounds
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update changelog.d/936.breaking.rst
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
* Compare methods using is
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>