MCPcopy Create free account
hub / github.com/STIXProject/python-stix / idref

Function idref

stix/utils/deprecated.py:10–22  ·  view source on GitHub ↗

Raises a Python UserWarning if `entity` arguments contains an idref value.

(entity)

Source from the content-addressed store, hash-verified

8
9
10def idref(entity):
11 """Raises a Python UserWarning if `entity` arguments contains an idref
12 value.
13
14 """
15 if not getattr(entity, 'idref', None):
16 return
17
18 fmt = ("The use of idrefs has been deprecated for this field. "
19 "Received '{0}' object with idref: '{1}'.")
20
21 msg = fmt.format(type(entity).__name__, entity.idref)
22 warnings.warn(msg)
23
24
25def field(instance, value):

Callers 1

insertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected