attrs
attrs copied to clipboard
Python Classes Without Boilerplate
I'm getting a new handy error from `mypy`: ```console src/ims/application/_main.py:74:2: error: cmp is deprecated, use eq and order [misc] ``` In order to make sure I'm using those correctly, I...
Say I have a base class Foo, where for every derived class I want to compute some class fields. This can easily be done with `__init_subclass__` in python. However, it's...
`attr.assoc` appears to have been deprecated in #169 and is now scheduled for removal in favor of `attr.evolve`, but the latter appears to not be able to do all that...
The current way of using True/False/None is confusing even to me. I propose we use an Enum (probably just class on legacy Python) a la: ```python class Hashing(Enum): SMART =...
Resolved: threads are bad. Nevertheless, `attr.s`ified objects are exactly the sorts of objects which I would use if I needed to jam some things into an inter-thread communication queue. Frozen...
in an attempt to make an attrs-decorated class programmatically from the output of the docopt argument parser, I discovered a situation where it is possible to create an attrs class...
Time for more existential questions. Currently attrs has involuntarily two ways of attaching its methods. Both come with certain problems and there are (or are suspected) remedies. We should really...
If you have an attribute for a file name, you might want to validate that the file actually exist. It that something to be useful with the default validators? (http://www.attrs.org/en/stable/api.html?highlight=validat#attr.validate)
As pointed out in https://github.com/ericvsmith/dataclasses/issues/42#issuecomment-330198369 `attr.evolve()` behaves rather weird if an attribute has 1. init=False, 2. a default/`__attrs_post_init__`, and 3. attribute(s) are modified on the instance. The new resulting object...
[this line](https://github.com/python-attrs/attrs/blob/0d04d5e7fc6de9eb6d70839dfda994d2a4bfa80f/src/attr/_make.py#L746) makes it impossible to have a class like the following. I believe it should be possible. ```python @attr.s class Foo: spam = attr.ib() eggs = attr.ib() _eggs =...