Skip to content

Instantly share code, notes, and snippets.

@gkmngrgn
Last active May 26, 2024 09:51
Show Gist options
  • Save gkmngrgn/a49daa449f80205062f24617962c8f9d to your computer and use it in GitHub Desktop.
Save gkmngrgn/a49daa449f80205062f24617962c8f9d to your computer and use it in GitHub Desktop.
class IpAddrKind:
V4 = 1
V6 = 2
class IpAddr:
def __init__(self, kind: IpAddrKind, address: str) -> None:
self.kind = kind
self.address = address
home = IpAddr(
kind=IpAddrKind.V4,
address="127.0.0.1",
)
loopback = IpAddr(
kind=IpAddrKind.V6,
address="::1",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment