Skip to content

Instantly share code, notes, and snippets.

@meadsteve
Created April 21, 2020 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meadsteve/4d93a0b7279be23004cc0b6e5ffd6793 to your computer and use it in GitHub Desktop.
Save meadsteve/4d93a0b7279be23004cc0b6e5ffd6793 to your computer and use it in GitHub Desktop.
class LolDomainString(str):
def __matmul__(self, other):
return LolDomainString(f"{self}@{other}")
def __getattr__(self, item):
return LolDomainString(f"{self}.{item}")
steve = LolDomainString("meadsteve")
gmail = LolDomainString("gmail")
com = LolDomainString("com")
print(steve @ gmail . com)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment