13 ms·
Python Communist Revolution
- Gentil 5y ago> Clone this git, pip install . where the git has been cloned, and you will have access to communism. This cracked me up. If only it was this easy, lol!
- sbassi 5y agoEqual to which class? If I have MyClass1 and MyClass2 with different body, after revolution, MyClass1 will be like MyClass2 or MyClass2 like MyClass1?
- kjgkjhfkjf 5y agoIt patches each class's __eq__ and __hash__ so they return True and hash(1) respectively.
- pdonis 5y agoYes, which means they also compare equal to any object whatever, and they hash equal to the integer 1 and the boolean True.
- swebs 5y agoReminds me of the silliness you'd see in "C Plus Equality" https://github.com/TheFeministSoftwareFoundation/C-plus-Equality https://github.com/TheFeministSoftwareFoundation/C-plus-Equa...
- danielodievich 5y agoAre some classes more equal than others?
- MichaelMoser123 5y agoyes, the built-in types are, as he can't change their __hash__ and __eq__ members (The purpose of this revolution is to have __hash__ and __eq__ return the same value)
- MichaelMoser123 5y agoI think that he could have changed the built-in types by means of the ctypes library https://docs.python.org/3/library/ctypes.html https://docs.python.org/3/library/ctypes.html Python goes with some mighty batteries... I am using ctypes here - to produce an execution trace of a running python program, where all the side effects are displayed: (had to use it in order to access some hidden members in the built-in frame type ;-) ) https://github.com/MoserMichael/pyasmtool/blob/master/tracer.md https://github.com/MoserMichael/pyasmtool/blob/master/tracer...
- 0x008 5y agoWow these articles are amazing. Great write up!
- MichaelMoser123 5y agoThank you, very encouraging. Really thanks!
- betwixthewires 5y agoThose notes... I love it.
- germandiago 5y agolol!
- jjk166 5y ago2008: cool you can import antigravity 2022: cool you can import communism
- SllX 5y agoExplains why I liked the Internet more in 2008 too.
- gunfighthacksaw 5y agoNothing will ever top those heady days of encyclopedia dramatica and peak 4chan, well nothing except for being a well adjusted adult who passes in mainstream society. Spasiba tovarischi!
- SllX 5y agoYes, but you could still find well adjusted adults in mainstream society once you closed 4chan. Unbelievable, underrated but true!
- xpressvideoz 5y agoAfter reading the initial section I thought this would hook up `isinstance` or something and make all class comparisons equal. But it turned out to be equalizing the instances of the classes. But still, I enjoyed the joke.
- vmception 5y ago> # We must protect the builtin elite to not be affected by the revolution > if inspect.isclass(c) and c.__name__ not in dir(__builtins__): A true comrade that safeguards the unity and sanctity of the state!
- fanzhang 5y agoSome classes must be more equal than others!
- vmception 5y agocomrade, this is but a necessary stepping stone towards a true classlessness, trust me!
- eesmith 5y agoTherein 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>}
- smitty1e 5y agoParaphrasing Trotsky: "You may not be interested in the dunderlectic, but the dunderlectic is interested in you."
- throwoutway 5y agoWhat is dunderlectic?
- smitty1e 5y agoA pun on __dunder__, for "double underscore", i.e. __init__() and dialectic, which was central to Trotsky's thought.
- dnautics 5y agodialectic was in Marx, he actually got it from Hegel. https://plato.stanford.edu/entries/hegel-dialectics/ https://plato.stanford.edu/entries/hegel-dialectics/
- mr_toad 5y agoDialectic’s are ancient, Socrates used a dialectic method. A lot of theology is dialectical in nature, and is partly why communism rejects religious explanations of the world.
- smitty1e 5y agoExcellent point, but not central to the paraphrase in view.
- dnautics 5y agojust wanted to add more to the history we were constructing! Didn't mean to imply that you implied that it was trotsky's idea.
- dnautics 5y ago
- deleted 5y ago[deleted]
- jaza 5y agoWe pretend to run, and they pretend to allocate us CPU and memory.
- MichaelMoser123 5y agoAll of them are virtual, so that pretence is not far from reality... (wait, wasn't that a joke about pretending to work vs pretending to pay a sallary ?)
- jdougan 5y agoThere are a couple forms but the version I saw most in english is "They pretend to pay us and we pretend to work."
- MichaelMoser123 5y agoi know another one, where Marx is asking the proletarians of all lands for forgiveness (playing on his ealier call "Proletarians of all Lands, Unite!")
- MichaelMoser123 5y agoi just thought about it, Mr jokteur is very lucky that he didn't get any jailtime in the Soviet Union for his jokes ... because they didn't have Python around, when they had the Soviet Union!
- tehjoker 5y agoTechnically a single class is the same as classless society. The single class denotes the resolution of class conflict with the dissolution of the concepts of upper and lower classes. I think it's fine.
- pdonis 5y agoIs it just me, or does this not even install correctly with pip install .?
- lopatin 5y agoOne does not simply pip install Communist Revolution. There are much more steps. Do you even have a manifesto?
- julius_deane 5y agoObviously an overlook mistake from our comrade jokteur. https://packaging.python.org/en/latest/guides/using-manifest-in/ https://packaging.python.org/en/latest/guides/using-manifest...
- pdonis 5y agoHe wouldn't need to use MANIFEST.in, just fixing setup.cfg would be enough. The simplest fix would be to set py_modules = communism and remove packages from setup.cfg altogether (and then the __init__.py file in src/ could be deleted since src/ is not a package).
- jokteur 5y agoAuthor of the project here. I took very little time to write this joke, this obviously an oversight from me. I was working on my conda installation, so I didn't look further. It is fixed now, it should be working.
- pdonis 5y agoYes, it works now. Note that since you have no packages, you can omit include_package_data = True from setup.cfg, and since you no longer have the src/ directory, you can omit the options.packages.find section from setup.cfg.
- erwincoumans 5y ago
- robertlagrant 5y agoThis is the first software implementation I would describe as "not doing enough to promote resource starvation".
- tehjoker 5y ago[flagged]
- randmeerkat 5y ago[flagged]
- shrimpx 5y ago[flagged]
- randmeerkat 5y ago[flagged]
- tomjen3 5y agoMaybe in theory, but in practice it looks very much the same if you are a jew starving to death, a kulak starving to death or a Chinese peasant starving to death.
- irthomasthomas 5y agoOr a Christian https://en.m.wikipedia.org/wiki/Holodomor https://en.m.wikipedia.org/wiki/Holodomor
- pasquinelli 5y ago[flagged]
- 5y ago
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- marczellm 5y ago
- asddubs 5y ago[flagged]
- ralph84 5y agoLol, the Red Guards certainly weren't beating their teachers to death out of love.
- deleted 5y ago[deleted]
- dang 5y agoPlease don't do this here.
- Claude_Shannon 5y agomhmm, sure. In Poland they send off around 1.5 million people to Siberia or Kazachstan. Around 150 000 of them died. Or you know, better example - Holodomor. Systematic killing of Ukrainian nation.
- linschn 5y ago[flagged]
- veltas 5y agoTrotsky and the people he followed were brutal and violent, Trotsky reaped what he sowed. Just because Stalin was more brutal and violent doesn't mean Trotsky was innocent. Please look up Decossackization, or read any of a number of serious critiques of Lenin. And then let's be honest about the rhetoric that Marx had to describe 'Capitalism' and what any Marxist revolt would likely entail... Marxism was rotten from the start.
- jakobov 5y agoHilarious
- einpoklum 5y agoI like how the author recognizes the significance of Unions to fomenting the Communist Revolution: https://github.com/jokteur/python_communism/blob/main/src/communism.py#L1 https://github.com/jokteur/python_communism/blob/main/src/co...
- jokteur 5y agoI am sorry, the file moved here: https://github.com/jokteur/python_communism/blob/main/communism.py#L1 https://github.com/jokteur/python_communism/blob/main/commun...
- yakshaving_jgt 5y agoHilarious. Now do one about the Holocaust.
- js8 5y agoWhen I was younger, I became a communist - I rejected the notion of a class, in favor of everything having a type. People often misunderstand communism, they think that abolishing classes means that all objects have to have equal value, and this gives programmer very little freedom. This is wrong; communism just means that we treat the types equally. However, we failed to build a truly classless programming language. There seem to be, quite naturally, different kinds of types. And even some of the most ambitious communist languages, like Haskell, have also embraced type classes! Although this compromise is not an entirely bad thing, since a type can select what type class it belongs to, instead of being assigned one at birth. I also admit that capitalist languages (the ones with classes) have been hugely successful. But communist (classless) programming language proponents claim that lot of the proclaimed productivity of capitalist languages is just an illusion, and also that many programmers lack the awareness that they, in fact, do not need classes. Often, there is nothing to lose than the call chains! On the other hand, one cannot easily dismiss arguments about totalitarian nature of communist languages - they openly embrace total functions, and they try to very strictly control input and output. Some claim that lazy evaluation by default might be another reason for their low productivity.
- reuben364 5y agoAs all types in Haskell are inhabited by undefined, any type can be made an instance of a typeclass. True type equality. {-# LANGUAGE GADTs, MultiParamTypeClasses, FlexibleInstances #-} data Eq a b = (a ~ b) => Eq class Revolution a b where eq :: Eq a b instance Revolution a b where eq = undefined
- kzrdude 5y agoTalk to your kids before they learn about Rust.
- yellowapple 5y agoCommunism is not just classless, but also stateless. Therefore, Python cannot be communist, because it is not a purely functional language.
- digianarchist 5y agoStatelessness is communism’s endgame which it never actually archives.
- 323 5y agoNot real communism (GitHub issue) https://github.com/jokteur/python_communism/issues/4 https://github.com/jokteur/python_communism/issues/4
- deleted 5y ago[deleted]
- ngcc_hk 5y agoClassless in a communist country you are joking … Read Animal farm. Told us abolishment of class is fake new and pr spin in the communist revolution. Actually the communist keep themselves as the superclass. Pig … strangely there are even upper class called human there. —- divided line we call this —- For IT, practically javascript is really classless as its class is just protocol in disguise…
- rplayxr 5y agoWhy has the truth about communism been censored in a thread about a communism-critical, satirical repo. Discussion is allowed, as long as the ugly parts aren't mentioned.
- 4ggr0 5y agoI don't see a single flagged comment, what are you on about? What do you want to tell us about communism which we haven't yet heard?
- bigyellow 5y ago
- 4ggr0 5y agoWe are so lucky that capitalism causes no distruction. The idea that constant growth is possible is also not insane at all ;)
- cptnapalm 5y agoSo, no rich text?