Created
April 21, 2020 10:44
-
-
Save meadsteve/4d93a0b7279be23004cc0b6e5ffd6793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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