attrs icon indicating copy to clipboard operation
attrs copied to clipboard

Python Classes Without Boilerplate

Results 166 attrs issues
Sort by recently updated
recently updated
newest added

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...

Documentation

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...

Feature

`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...

Cleanup

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 =...

Cleanup

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...

Bug

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...

Cleanup

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...

Thinking

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)

Feature

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...

Bug

[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 =...

Bug