MCPcopy
hub / github.com/python-attrs/attrs / simple_attr

Function simple_attr

tests/utils.py:39–68  ·  tests/utils.py::simple_attr

Return an attribute with a name and no other bells and whistles.

(
    name,
    default=NOTHING,
    validator=None,
    repr=True,
    eq=True,
    hash=None,
    init=True,
    converter=None,
    kw_only=False,
    inherited=False,
)

Source from the content-addressed store, hash-verified

37
38
39def simple_attr(
40 name,
41 default=NOTHING,
42 validator=None,
43 repr=True,
44 eq=True,
45 hash=None,
46 init=True,
47 converter=None,
48 kw_only=False,
49 inherited=False,
50):
51 class="st">"""
52 Return an attribute with a name and no other bells and whistles.
53 class="st">"""
54 return Attribute(
55 name=name,
56 default=default,
57 validator=validator,
58 repr=repr,
59 cmp=None,
60 eq=eq,
61 hash=hash,
62 init=init,
63 converter=converter,
64 kw_only=kw_only,
65 inherited=inherited,
66 alias=_default_init_alias_for(name),
67 alias_is_default=True,
68 )

Callers 15

test_theseMethod · 0.85
test_successMethod · 0.85
test_subclassMethod · 0.85
test_failMethod · 0.85
test_successMethod · 0.85
test_failMethod · 0.85
test_successMethod · 0.85
test_failMethod · 0.85
test_failMethod · 0.85
test_fail_with_stringMethod · 0.85

Calls 2

AttributeClass · 0.90
_default_init_alias_forFunction · 0.90

Tested by 15

test_theseMethod · 0.68
test_successMethod · 0.68
test_subclassMethod · 0.68
test_failMethod · 0.68
test_successMethod · 0.68
test_failMethod · 0.68
test_successMethod · 0.68
test_failMethod · 0.68
test_failMethod · 0.68
test_fail_with_stringMethod · 0.68