MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / Integer

Function Integer

src/commoncode/datautils.py:141–166  ·  view source on GitHub ↗

Return an integer attribute.

(
    default=0,
    validator=None,
    repr=False,
    eq=True,
    order=True,  # NOQA
    converter=None,
    label=None,
    help=None,
)

Source from the content-addressed store, hash-verified

139
140
141def Integer(
142 default=0,
143 validator=None,
144 repr=False,
145 eq=True,
146 order=True, # NOQA
147 converter=None,
148 label=None,
149 help=None,
150): # NOQA
151 """
152 Return an integer attribute.
153 """
154 converter = converter or attr.converters.optional(int)
155 return attribute(
156 default=default,
157 validator=validator,
158 repr=repr,
159 eq=eq,
160 order=order,
161 init=True,
162 type=int,
163 converter=converter,
164 help=help,
165 label=label,
166 )
167
168
169def Float(

Callers 2

FileReferenceClass · 0.90
PackageDataClass · 0.90

Calls 1

attributeFunction · 0.70

Tested by

no test coverage detected