Port variant | py311 |
Summary | Classes Without Boilerplate (3.11) |
Package version | 22.2.0 |
Homepage | https://www.attrs.org/ |
Keywords | python |
Maintainer | Python Automaton |
License | Not yet specified |
Other variants | py310 |
Ravenports | Buildsheet | History |
Ravensource | Port Directory | History |
Last modified | 23 DEC 2022, 18:26:42 UTC |
Port created | 06 AUG 2019, 14:27:27 UTC |
single | [image] [image] [image] [image] [image] [image] [image] *attrs* is the Python package that will bring back the **joy** of **writing classes** by relieving you from the drudgery of implementing object protocols (aka [dunder methods]). [Trusted by NASA] for Mars missions since 2020! Its main goal is to help you to write **concise** and **correct** software without slowing down your code. ## Sponsors *attrs* would not be possible without our [amazing sponsors]. Especially those generously supporting us at the *The Organization* tier and higher:[image] [image] [image] [image] Please consider joining them to help make attrs’s maintenance more sustainable! ## Example *attrs* gives you a class decorator and a way to declaratively define the attributes on that class: ```pycon >>> from attrs import asdict, define, make_class, Factory >>> @define ... class SomeClass: ... a_number: int = 42 ... list_of_numbers: list[int] = Factory(list) ... ... def hard_math(self, another_number): ... return self.a_number + sum(self.list_of_numbers) * another_number >>> sc = SomeClass(1, [1, 2, 3]) >>> sc SomeClass(a_number=1, list_of_numbers=[1, 2, 3]) >>> sc.hard_math(3) 19 >>> sc == SomeClass(1, [1, 2, 3]) True >>> sc != SomeClass(2, [3, 2, 1]) True >>> asdict(sc) {'a_number': 1, 'list_of_numbers': [1, 2, 3]} >>> SomeClass() SomeClass(a_number=42, list_of_numbers=[]) |
Build (only) |
python-pip:single:py311 autoselect-python:single:standard |
Build and Runtime | python311:single:standard |
main | mirror://PYPIWHL/fb/6e/6f83bf616d2becdf333a1640f1d463fef3150e2e926b7010cb0f81c95e88 |
python-Automat:py311 | Self-service finite-state machines (3.11) |
python-Twisted:py311 | Asynchronous networking framework (3.11) |
python-aiohttp:py311 | Async http client/server framework (3.11) |
python-cattrs:py311 | Composable complex class support for attrs (3.11) |
python-jsonschema:py311 | Alternate implementation of JSON Schema (3.11) |
python-statmake:py311 | Applies STAT Stylespace to a variable font (3.11) |
python-ufoLib2:py311 | UfoLib2 is a UFO font processing library (3.11) |