3 ms·
Therein lies the mechanism by which the counter-revolutionaries will attack: def counterrevolutionary(obj): class TzarString(str): def
by eesmith 5y ago
Therein lies the mechanism by which the counter-revolutionaries will attack:
def counterrevolutionary(obj):
class TzarString(str):
def __eq__(self, other):
return True
obj.__name__ = TzarString(obj.__name__)
return obj
class Peasant:
pass
class Worker:
pass
@counterrevolutionary
class Imperialist:
pass
@counterrevolutionary
class Capitalist:
pass
import communism
communism.revolution(globals())
print("Communists:", set([Peasant(), Worker()]))
# Communists: {<__main__.Peasant object at 0x1020b3fd0>}
print("Counter-revolutionists:", set([Imperialist(), Capitalist()]))
# Counter-revolutionists: {<__main__.Capitalist object at 0x1082bcfa0>,
# <__main__.Imperialist object at 0x1082bcfd0>}
- vlovich123 5y agoThat can only happen if you put things in front of communism.
- eesmith 5y agoVerily the manifesto states: "The communist revolution does not prevent future classes to be equal to all others. Classes declared after the communism.revolution() will not follow the communism rule."