MCPcopy Create free account
hub / github.com/secdev/scapy / __init__

Method __init__

scapy/fields.py:1289–1297  ·  view source on GitHub ↗
(self, name, default, config=None)

Source from the content-addressed store, hash-verified

1287 self.eval_fn = lambda x: assoc_table[x] if x in assoc_table else x
1288
1289 def __init__(self, name, default, config=None):
1290 # type: (str, int, Optional[Dict[str, Any]]) -> None
1291
1292 if not config:
1293 # this represents the common use case and therefore it is kept small # noqa: E501
1294 self.eval_fn = lambda x: 'no' if x == 0 else 'yes'
1295 else:
1296 self._build_config_representation(config)
1297 ByteField.__init__(self, name, default)
1298
1299 def i2repr(self, pkt, x):
1300 # type: (Optional[Packet], int) -> str

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected