Tin Tvrtković
Tin Tvrtković
I've run into this as well. Unfortunately there's no easy solution as of yet. My advice for now is just use dict-based classes if you need cached properties.
Well, yes, of course. Let's leave this open to track the issue. Consider the elegance of cached properties when applied to dict classes. Suppose you have a class `A` and...
Does the stdlib cached property work with normal (non-attrs) slotted classes?
My line of thinking was basically that: * converters are a superset of validators (they can do everything validators do, and more) * converters have a less powerful interface than...
So I'm going to go a step further and say we should deprecate and later remove the global validator switch. My reasoning: 1. All our `__init__`s that contain validators pay...
What if we could pull this off: ``` @attr.s class A: a = attr.ib(validator=instance_of(int)) with disable_validators(A): A(None) ``` and remove the check in the default `__init__` at the same time?
The implementation I'm imagining would monkeypatch the `__init__` on `A` for the duration of the context manager. So it wouldn't work globally (unless we maintain a list of all attrs...
> The gc module is a wonderful thing. I needed to Google the `gc` API before I understood this point. It's so wonderfully evil I'm on board. But how do...
Alas, no PyCon for me. Please corner Guido in a dark alley and demand immutable dictionaries.
Interesting, looks like a Mypy bug to me. Possibly in the attrs Mypy plugin. Using `reveal_type`, the output is identical. Same file: ``` note: Revealed type is "Overload(def (value: None),...