Python3的矩阵乘法的好玩玩法
-
In [1]: class G: ...: def __init__(self, s): ...: self.s = s ...: def __getattr__(self, t): ...: return G(self.s + '.cn') ...: def __rmatmul__(self, other): ...: return other + '@' + self.s ...: ...: fun, games = '无脑者', G('愚蠢国度') ...: print([email protected]) ...: ...: 无脑者@愚蠢国度.cn