attrs
attrs copied to clipboard
Python Classes Without Boilerplate
Attempting to create a generic attrs class with `slots=True` fails if it does not inherit from some other generic class. ```python from typing import TypeVar, Generic, Container from unittest import...
Heya, minor issue with typing: This passes mypy type checking: ```python @attr.s() class MdParserConfig: url_schemes: Optional[Iterable[str]] = attr.ib( default=None, validator=optional(deep_iterable(instance_of(str), instance_of((list, tuple)))), ) ``` but then weirdly changing the default...
While 37d38c4 is pretty cool, when working on it it was very obvious to me, that it should be united with converter. After @Tinche pointed it out too, there’s no...
It would be nice to have control over what happens when someone attempts to set a non-optional attribute values explicitly to `None`: set default value, or raise `ValueError`. The following...
I'm already using attrs to implement several internal ORMs, and attrs (with cattrs) is very good for this. However I find myself missing a feature. Consider the following code: ```...
In the same manner as `attr.asdict(..., recursive=True)` exists, I have a use case for a similar option to `attr.evolve()`. I want all attr instances evolved, but with no need to...
Hello! Thanks again for the great library! :) After answering in a couple of issues regarding default values on class-level and debugging another mess with self-using factory which was fixed...
Hi there, I'm looking for a way to read default value for an attribute from **os.environ** The natural way i see for this is to use a **attr.Factory** in combination...
My framework relies on (smart) subclassing, but I've also got it to work with attrs mostly. Running into a problem like the following. ``` @attr.s class BaseClass(): value = attr.ib(default=10)...
This is related to #300, #339, and #343, but this issue doesn't just occur with attr.make_class but also normal classes defined across modules. I am submitting this issue not necessarily...