MCPcopy Index your code
hub / github.com/secdev/scapy / _ScopedIP

Class _ScopedIP

scapy/base_classes.py:112–125  ·  view source on GitHub ↗

A str that also holds extra attributes.

Source from the content-addressed store, hash-verified

110
111
112class _ScopedIP(str):
113 """
114 A str that also holds extra attributes.
115 """
116 __slots__ = ["scope"]
117
118 def __init__(self, _: str) -> None:
119 self.scope = None
120
121 def __repr__(self) -> str:
122 val = super(_ScopedIP, self).__repr__()
123 if self.scope is not None:
124 return "ScopedIP(%s, scope=%s)" % (val, repr(self.scope))
125 return val
126
127
128def ScopedIP(net: str, scope: Optional[Any] = None) -> _ScopedIP:

Callers 1

ScopedIPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected