author | Pierre-Yves David <pierre-yves.david@octobus.net> |
Tue, 11 Mar 2025 02:29:42 +0100 | |
branch | stable |
changeset 53042 | cdd7bf612c7b |
parent 49643 | e1c586b9a43c |
permissions | -rw-r--r-- |
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
1 |
# SPDX-License-Identifier: MIT |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
2 |
|
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
3 |
|
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
4 |
import sys |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
5 |
|
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
6 |
from functools import partial |
34397 | 7 |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
8 |
from . import converters, exceptions, filters, setters, validators |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
9 |
from ._cmp import cmp_using |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
10 |
from ._config import get_run_validators, set_run_validators |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
11 |
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types |
34397 | 12 |
from ._make import ( |
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
13 |
NOTHING, |
34397 | 14 |
Attribute, |
15 |
Factory, |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
16 |
attrib, |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
17 |
attrs, |
34397 | 18 |
fields, |
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
19 |
fields_dict, |
34397 | 20 |
make_class, |
21 |
validate, |
|
22 |
) |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
23 |
from ._version_info import VersionInfo |
34397 | 24 |
|
25 |
||
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
26 |
__version__ = "22.1.0" |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
27 |
__version_info__ = VersionInfo._from_version_string(__version__) |
34397 | 28 |
|
29 |
__title__ = "attrs" |
|
30 |
__description__ = "Classes Without Boilerplate" |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
31 |
__url__ = "https://www.attrs.org/" |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
32 |
__uri__ = __url__ |
34397 | 33 |
__doc__ = __description__ + " <" + __uri__ + ">" |
34 |
||
35 |
__author__ = "Hynek Schlawack" |
|
36 |
__email__ = "hs@ox.cx" |
|
37 |
||
38 |
__license__ = "MIT" |
|
39 |
__copyright__ = "Copyright (c) 2015 Hynek Schlawack" |
|
40 |
||
41 |
||
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
42 |
s = attributes = attrs |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
43 |
ib = attr = attrib |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
44 |
dataclass = partial(attrs, auto_attribs=True) # happy Easter ;) |
34397 | 45 |
|
46 |
__all__ = [ |
|
47 |
"Attribute", |
|
48 |
"Factory", |
|
49 |
"NOTHING", |
|
50 |
"asdict", |
|
51 |
"assoc", |
|
52 |
"astuple", |
|
53 |
"attr", |
|
54 |
"attrib", |
|
55 |
"attributes", |
|
56 |
"attrs", |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
57 |
"cmp_using", |
34397 | 58 |
"converters", |
59 |
"evolve", |
|
60 |
"exceptions", |
|
61 |
"fields", |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
62 |
"fields_dict", |
34397 | 63 |
"filters", |
64 |
"get_run_validators", |
|
65 |
"has", |
|
66 |
"ib", |
|
67 |
"make_class", |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
68 |
"resolve_types", |
34397 | 69 |
"s", |
70 |
"set_run_validators", |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
71 |
"setters", |
34397 | 72 |
"validate", |
73 |
"validators", |
|
74 |
] |
|
49643
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
75 |
|
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
76 |
if sys.version_info[:2] >= (3, 6): |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
77 |
from ._next_gen import define, field, frozen, mutable # noqa: F401 |
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
78 |
|
e1c586b9a43c
attr: vendor 22.1.0
Matt Harbison <matt_harbison@yahoo.com>
parents:
34397
diff
changeset
|
79 |
__all__.extend(("define", "field", "frozen", "mutable")) |