Comments (8)
Eh could you rephrase + elaborate please? I have a nasty head cold and can’t entirely follow. :)
from attrs.
Let me try again :)
As in #28, the speed difference is because we iterate over the attr descriptors using fields
, which makes a deepcopy
for every field.
In #28, we've fixed it by iterating using inst.__class__.__attrs_attrs__
. I was about to prepare a PR to do the same here, but then realized that the deepcopy may have bene intentional in this case. If not, I will be happy to prepare a PR to fix this.
from attrs.
Um this would only matter, if someone would modify the attribute list in their container, right? (which they never should)
from attrs.
Ok, let me prepare a PR then.
What is the rationale for using deepcopy
in fields
then ?
from attrs.
I find there’s a difference between a public API like fields and misbehaving in an converter. But maybe I’m wrong. :)
from attrs.
do you think you can get it done by say Wed? I’d like to push out a release before PyCon
from attrs.
looks like I could ! Too bad I could not make it up this year at PyCon...
from attrs.
aw :(
from attrs.
Related Issues (20)
- Optional inner validators for `deep_mapping`
- Add support for marking classes `typing.final` HOT 3
- Is it possible to validate all attribute types by default?
- Convenience decorators for promoting functions to attrs-compatible validators HOT 4
- Define defaults for subclass that uses validator of parent class? HOT 1
- Multiple inheritance produces a TypeError (though dataclasses work fine) HOT 2
- How to derive multiple fields from one complex input dict? HOT 1
- 23.2.0: pytest fails in `tests/test_funcs.py::TestAssoc::test_unknown` unit HOT 1
- make_class(): Populate the __annotations__ dict HOT 3
- License file not included in distribution HOT 1
- Docs should clearly describe `pyright` interaction patterns. HOT 3
- Using `typing.Annotated` HOT 4
- Pyright 1.1.359 broke our CI
- Mypy 1.10 broke our CI
- Error from mypy when using converters in a list HOT 6
- Crash when annotating type with the python syntax (a: T = attrib()) HOT 2
- modulenotfounderror: no module named attrs for version 21.2.0 HOT 1
- `kw_only` with `default` breaks `__attrs_pre_init__` call
- Add "resolve_types" argument to attrs.define() HOT 1
- Typing error when defining an enum of an attrs class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from attrs.