Convert internal value to machine value
(self, pkt, x)
| 211 | return cast(I, x) |
| 212 | |
| 213 | def i2m(self, pkt, x): |
| 214 | # type: (Optional[Packet], Optional[I]) -> M |
| 215 | """Convert internal value to machine value""" |
| 216 | if x is None: |
| 217 | return cast(M, 0) |
| 218 | elif isinstance(x, str): |
| 219 | return cast(M, bytes_encode(x)) |
| 220 | return cast(M, x) |
| 221 | |
| 222 | def any2i(self, pkt, x): |
| 223 | # type: (Optional[Packet], Any) -> Optional[I] |
no test coverage detected