Commit Graph

6 Commits

Author SHA1 Message Date
Rebecca Turner e84b57ea68
Inline distutils.util.strtobool in tests (closes #813) (#830)
* Inline distutils.util.strtobool in tests (#813)

`distutils` is deprecated in Python 3.10 and slated for removal in
Python 3.12. Fortunately, `attrs` only uses `distutils` once and it's
trivial to remove.

As suggested by @sscherfke, add the `to_bool` converter to
`converters.py`.

Closes #813

Co-authored-by: Stefan Scherfke <stefan@sofa-rockers.org>

* Use :raises: directive in docstring

* Remove f-strings for Py2.7 and 3.5 support

* Add to_bool tests

Co-authored-by: Stefan Scherfke <stefan@sofa-rockers.org>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-08-10 07:45:28 +02:00
Hynek Schlawack 05e930c36f
Rename converters.chain to converters.pipe
Consistent with setters.pipe and conveys better that it acts like a UNIX pipe.

Signed-off-by: Hynek Schlawack <hs@ox.cx>
2020-07-21 14:43:09 +02:00
Nativ Issac 9fcfe3479f Add and_ converter (#618)
* Add and_ converter

* update _make

* Refactored code according to review

* fixed some linting errors

* minor refactor

* fixed CR comments

* fixed CR comment #2

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2020-03-06 10:34:11 +01:00
Hynek Schlawack afd2584470
Implement attr.converters.default_if_none (#414)
* Implement attr.converters.default_if_none

fixes #400

* Comment out typing example for now

* Add PR newsfragment

* Fix linter
2018-07-28 16:03:41 +01:00
Hynek Schlawack a372d51b7b
Fade to Black (#392) 2018-06-10 19:40:07 +02:00
Timothy Emiola fdfd51e249 Allow optional conversion (#173)
Fixes #105
2017-05-10 15:37:50 +02:00