MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / Boolean

Class Boolean

pager_lib/pyasn1/type/univ.py:262–323  ·  view source on GitHub ↗

Create |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python :class:`

Source from the content-addressed store, hash-verified

260
261
262class Boolean(Integer):
263 """Create |ASN.1| schema or value object.
264
265 |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its
266 objects are immutable and duck-type Python :class:`int` objects.
267
268 Keyword Args
269 ------------
270 value: :class:`int`, :class:`str` or |ASN.1| object
271 Python :class:`int` or :class:`str` literal or |ASN.1| class
272 instance. If `value` is not given, schema object will be created.
273
274 tagSet: :py:class:`~pyasn1.type.tag.TagSet`
275 Object representing non-default ASN.1 tag(s)
276
277 subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection`
278 Object representing non-default ASN.1 subtype constraint(s).Constraints
279 verification for |ASN.1| type occurs automatically on object
280 instantiation.
281
282 namedValues: :py:class:`~pyasn1.type.namedval.NamedValues`
283 Object representing non-default symbolic aliases for numbers
284
285 Raises
286 ------
287 ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error
288 On constraint violation or bad initializer.
289
290 Examples
291 --------
292 .. code-block:: python
293
294 class RoundResult(Boolean):
295 '''
296 ASN.1 specification:
297
298 RoundResult ::= BOOLEAN
299
300 ok RoundResult ::= TRUE
301 ko RoundResult ::= FALSE
302 '''
303 ok = RoundResult(True)
304 ko = RoundResult(False)
305 """
306 #: Set (on class, not on instance) or return a
307 #: :py:class:`~pyasn1.type.tag.TagSet` object representing ASN.1 tag(s)
308 #: associated with |ASN.1| type.
309 tagSet = tag.initTagSet(
310 tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 0x01),
311 )
312
313 #: Set (on class, not on instance) or return a
314 #: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` object
315 #: imposing constraints on |ASN.1| type initialization values.
316 subtypeSpec = Integer.subtypeSpec + constraint.SingleValueConstraint(0, 1)
317
318 #: Default :py:class:`~pyasn1.type.namedval.NamedValues` object
319 #: representing symbolic aliases for numbers

Callers 15

initializeSocketFunction · 0.85
refreshPwnagotchiStatusFunction · 0.85
updatePwnagotchiUIFunction · 0.85
_setPwnCfgCheckedFunction · 0.85
updatePwnDiscoveredCardFunction · 0.85
startPwnLogStreamingFunction · 0.85
checkPwnUpdatesFunction · 0.85
updateReleaseGateStateFunction · 0.85

Calls 1

getTypeIdMethod · 0.80

Tested by

no test coverage detected