158 comments

[ 1.2 ms ] story [ 3167 ms ] thread
Equal to which class? If I have MyClass1 and MyClass2 with different body, after revolution, MyClass1 will be like MyClass2 or MyClass2 like MyClass1?
Are some classes more equal than others?
yes, 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)
I think that he could have changed the built-in types by means of the ctypes library 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...

Wow these articles are amazing. Great write up!
2008: cool you can import antigravity

2022: cool you can import communism

Explains why I liked the Internet more in 2008 too.
Nothing 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!
Yes, but you could still find well adjusted adults in mainstream society once you closed 4chan. Unbelievable, underrated but true!
After 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.
> # 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!

Some classes must be more equal than others!
comrade, this is but a necessary stepping stone towards a true classlessness, trust me!

  object.__setattr__=lambda x,y,z:None
if we do this, the state will surely wither away![0]

[0]: Doesn't actually work :(

You may have some concerns due to past events throughout history. But don't worry. That wasn't real Python.
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>}
That can only happen if you put things in front of communism.
Verily 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."
it’s called “python characteristics”
Paraphrasing Trotsky: "You may not be interested in the dunderlectic, but the dunderlectic is interested in you."
What is dunderlectic?
A pun on __dunder__, for "double underscore", i.e. __init__() and dialectic, which was central to Trotsky's thought.
dialectic was in Marx, he actually got it from Hegel. https://plato.stanford.edu/entries/hegel-dialectics/
Excellent point, but not central to the paraphrase in view.
just wanted to add more to the history we were constructing! Didn't mean to imply that you implied that it was trotsky's idea.
Dialectic’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.
dialectic + dunders (double underscore, which signifies certain things in python)
(comment deleted)
We pretend to run, and they pretend to allocate us CPU and memory.
All 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 ?)
There are a couple forms but the version I saw most in english is "They pretend to pay us and we pretend to work."
i know another one, where Marx is asking the proletarians of all lands for forgiveness (playing on his ealier call "Proletarians of all Lands, Unite!")
i 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!
Technically 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.
Yeah it doesn’t seem like people here realize the way to get to a classless society is for the proletariat to suppress the upper classes and whither the state. That’s kinda the point!
Is it just me, or does this not even install correctly with pip install .?
One does not simply pip install Communist Revolution. There are much more steps. Do you even have a manifesto?
Obviously an overlook mistake from our comrade jokteur.

https://packaging.python.org/en/latest/guides/using-manifest...

He 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).
Author 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.

Yes, 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.
> not even install correctly with pip install

Big surprise. :p

Consult your little red book. It explains the situation very clearly.
Author of the project here. I fixed the issue.

But I think it unintentionally not working first time is speaking for itself.

Saw the fix, thanks!

Was it also unintentional that instances of classes, after they have been converted to communism, compare equal with anything whatever, and hash equal to the integer 1 and the boolean True?

  >>> import communism
  >>> class MyClass1:
  ...     pass
  ...
  >>> class MyClass2:
  ...     pass
  ...
  >>> communism.revolution(globals())
  >>> MyClass1() == None
  True
  >>> set((MyClass1(), MyClass2(), 1, True))
  {<__main__.MyClass1 object at 0x7f8f3532a820>}
  >>>
This is the first software implementation I would describe as "not doing enough to promote resource starvation".
Communism is very different from fascism. I’m surprised and concerned at how often the two are conflated.
Maybe totalitarianism would be more accurate? That seems to encompass them both based on their similarities.
Maybe 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.
then capitalism is the same too.
Good point. Remember after the fall of the Soviet Union all the Russians being shocked at how empty the shelves were in America?
Because humans mix those two together in reality.

Tell the civilians its communism, but in reality it is facism..

You know, fascism is a quite specific thing, not a slender word for dictatorship.

You are talking about the the "proletarian dictatorship" that supposedly is needed.

Yeah I shouldn't have used the word fascism, which isn't what Marx/Lenin were prescribing. But in practice, the implementations of Nazi fascism and Bolshevik totalitarianism were virtually indistinguishable. Ultranationalist, centralized control of production and social norms, favored in-group, elimination of dissenters, expansionist/striving to colonize the planet, etc.
Fascism and Communism aren't the same. Communism defines the people who should die based on class; Fascism does it based on nation.
According to western media. Maybe they should have researched more closely.
You should read the book Tombstone by Yang Jisheng.
China is contributing their fair share of pollution too.

It's not communism or capitalism that are producing environmental damage, it's scientific progress and rapidly rising standards of living which are desirable goals for both systems. Just capitalism is better at achieving those goals. Under communism with their mismanagement of resources, i would bet you would see more pollution and less scientific advancement and lower standards of living.

China is integrated into the world economy as another (massive) capitalist entity.[1]

One can raise the standards of living and make scientific advancements at the cost of destroying the planet with regards to human habitation and survival. But I [don’t] see how any sane person would make that argument.

No one can argue against the fact that capitalism has brought about things like scientific advancements, AC and whatnot. So it is very good at the objective of expand-expand-expand. And now we see where that will lead us.

I hope you ideological handmaidens of this system will sleep well for the next decades. Probably you will since you will just make up excuses about how all other external factors were really the cause. Or: All good things in the world were caused by capitalism while all bad things were caused by some inherent human traits (greed, malice) that would have manifested themselves in any system or context.

[1] In before “but China is communist”: then, for the sake of consistency, all “made in China” products were in large part made possible by Communism. And I hear there are a lot of consumer products that are made in China.

The Chinese state has enough power to significantly reduce China's emissions if it wanted to.
Why should China reduce their emissions?

>To date, China’s size has meant that its per capita emissions have remained considerably lower than those in the developed world ..... This comes in just below average levels across the OECD bloc (10.5 tons/capita) in 2019, but still significantly lower than the US, which has the highest per capita emissions in the world at 17.6 tons/capita

Per capita emissions of USA is way higher than that of China despite China bearing the brunt of manufacturing.

> A large share of the CO2 emitted into the atmosphere each year hangs around for hundreds of years. As a result, current global warming is the result of emissions from both the recent and more distant past. Since 1750, members of the OECD bloc have emitted four times more CO2 on a cumulative basis than China

Isn't it hypocritical to have devoloped through the 19th and 20th century by polluting the atmosphere but then accuse China when it their turn to develop?

source: https://rhg.com/research/chinas-emissions-surpass-developed-...

> Why should China reduce their emissions?

Because, according to your chart, they are the greatest emitter. If they don't reduce that's bad.

> Per capita emissions of USA is way higher than that of China despite China bearing the brunt of manufacturing.

Per capita emissions are dropping in the US already, but they are increasing in China.

> Isn't it hypocritical to have developed through the 19th and 20th century by polluting the atmosphere but then accuse China when it their turn to develop?

No, it would be hypocritical to claim that the technological development achieved by western countries (emitting CO₂ as a side-effect) didn't help China.

The year is 2020. Covid tests are a scarce resource. The federal government places "big orders" (NPR) and distributes them according to its own calculation. 845 million tests are performed, free of charge.

A million of them are later found to have expired for lack of demand. The FDA redefines the shelf life.

The federal government orders a billion more at-home tests.

People who will retire at 40 blame capitalism.

(comment deleted)
(comment deleted)
mhmm, 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.

Trotsky getting an Ice pickaxe to the head should be a hint to you that whatever happened with the USSR was not exactly in line with Marxism.
Trotsky 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.
I'd be interested in pointers to any of the serious critiques you mention.

I find reading the early revolutionary sources for the French, American and Russian revolutions that they're really not asking for anything we modern folk would consider too wild, since they were basically reacting against monarchy, aristocracy or a proto-capitalism run largely by the aristocaracy.

Comparing Russia against America with its long, if flawed, history of Socialist (yes really) and Republican (as in anti-monarchy) Democracy seems to make much less sense when the revolutionaries that apparently should have known what Marxism or "The Terror" would lead to were asking for that same basic stuff as the American ones.

I mean the basic point of this python joke (other than punning on 'class') hinges on "all men are created equal"

https://en.m.wikipedia.org/wiki/All_men_are_created_equal

And the famous Animal Farm seems to take a similar view:

https://www.cliffsnotes.com/literature/a/animal-farm/critica...

Well in both the French and Russian revolutions the people who were advocating for sensible reforms and who started the revolutions were not the same people who ended up in charge and who perpetrated the red terror. The Bolsheviks did not overthrow the Tsar, they came to power after ousting a (highly ineffective) liberal-socialist government, much like the Jacobins who replaced relatively more moderate republicans.
Is that true though?

The Jacobins got executed and replaced by the Thermidorian Reaction, which was a shift "rightward" and may have paved the way for Napoleon. And France generally also had to fight wars against the combined monarchies of Europe (which they generally did and won) which again, paved the way for Napoleon to become emperor.

I'm still at the early stages of reading up on Russia, but the Bolsheviks at the time are "radical" but aren't really calling for more than what we'd view as actual democracy. By "sensible reforms" I assume you mean people who advocate mostly just leaving concentrated wealth concentrated, and then obviously you've got wars and outside empires there too as well as the remains of the concentrated wealth.

I dunno, it feels like there's centuries of cultural and political propaganda that gets in the way of objective views on this.

I just meant that Jacobins did not start the revolution, moderate constitutional monarchists (and the mob in Paris) did. Of course things went out of hands and by 1794 most of the original leaders from 1789: Duc d'Orléans, Lafayette, Mirabeau, Sieyès, Necker etc. were all out of power, dead or in exile. All of them were considered to liberals when the Estates-General were initially convened however compared to the Jacobins they might as well had been ultra-conservatives.

The Bolsheviks publicly called for whatever was popular at the time and what they thought would allow them to get into power. In 1918 they basically copied the entire Socialist Revolutionary programme (ending the war and distributing all land to the peasants without compensation to previous landowners and giving controls of the factories to their workers) and promised to end the war which basically guaranteed that most soldiers and ordinary people would not oppose them (they never had mass public support prior to the October revolution, at best a plurality in Major cities and approximately 0% in the countryside). However after they ousted the socialist government they proceeded with a policy of collectivization and centralization instead.

"aren't really calling for more than what we'd view as actual democracy"

No, the Bolsheviks lost the first democratic elections in Russian history, decided they don't like the results and dispersed Russian Constituent Assembly 13 hours after it convened. Unlike most other socialists in Russia at the time Bolsheviks were totally anti democratic from the outset, which is why they were so effective at gaining and holding power. While other socialist or liberal parties were organizing peaceful public protests, strikes or walkouts expecting that the masses would rally around them the bolsheviks simply sent in their troops.

That was kind of an occupational hazard; Trotsky didn't have any qualms, when he was in charge.
He did in fact have lots of qualms. The history of the various Communist Internationals are all about left/right wing conflict within the party. Even during the revolution there was constant dissent and debate, which some might regard as healthy - until the right-wing of the party (Stalin & friends) laid waste to democratic processes.
I meant to say that he didn't have any qualms with the 'counter revolutionaries', party internal discussions were a different thing altogather. Also you can't just label these discussions as 'democratic processes', this was a Leninist party 'of the new type'; everyone was supposed to stick to the party line without questions, once a decission was made.
You are referring to democratic centralism, which is a form of democracy.
Democratic centralism is a form of democracy, that only gives a voice to a very limited number of cadres, which is the exact opposite of a democracy. It excludes anyone who is not a communist party member by its definition, even in it's most inclusive form. This is motivated by the 'vanguard' role of the party - you see that it is a very insincere form of democracy, as such. The inevitable result of this this form of democracy, as you call it, is the concentration of all power in a very select cirlce of leaders. In other words, the result is a stalinist nightmare, and it doesn't matter who is in charge of the show, the end result is always the same.
i think that this story should really be taken as a warning to everyone: if you start to curtail democracy by limiting its domain, then you really end up with the exact opposite of it.
"Decossackization" to add to the list.
and america was built by slaves on land taken from indians. does that make capitalism bad, or democracy? or america?

it's irritating how smart someone can think they are for saying something so stupid, a stupid thing they repeated from someone who repeated it from someone who repeated it from....

doesn't it get tiresome? you and i must both know this same conversation has happened a million times, maybe even word for word. why bother?

i really shouldn't involve myself.

you're confusing what communism is about and what people did

In Italy existed a communist party for 70 years, from 1921 to 1992, it was called PCI (Italian Communist Party) and did nothing of the sort while at its peak obtaining almost 40% of the votes in free elections they supported and helped to build fighting for Italian liberation from nazi-fascism (among other partisan groups)

we don't mix the concept of free country with slavery because USA did it for 2 centuries, do we?

I understand US of A has been indoctrinated to anti communism and prefer being pro-nazi than mildly socialist, but it's a big mistake nonetheless.

>you're confusing what communism is about and what people did

The trouble with communism is as ever that it has to be implemented by people. Communists as ever tend to gloss over this detail. As once-Marxist economist Thomas Sowell put it: great idea, wrong species.

> The trouble with communism is as ever that it has to be implemented by people

Like everything else! Big surprise!

Have you ever seen capitalism implemented by plants or AI developed by rocks?

> Communists as ever tend to gloss over this detail.

Some do, many don't.

You're implying that communists are somewhat lesser people than other.

But they are just like everybody else.

Do you realize that in 2021 an elected president of USA said nothing about literal nazis assaulting the Capital hill?

does it say something about the american way?

> As once-Marxist economist Thomas Sowell

"Sowell writes from a libertarian–conservative perspective"

You missed the “once-” before “Marxist:”

Sowell described his serious study of Karl Marx in his autobiography; as a former Marxist who early in his career became disillusioned with the philosophy, he emphatically opposes Marxism, providing a critique in his book Marxism: Philosophy and Economics (1985).

https://en.wikipedia.org/wiki/Thomas_Sowell

I did not, I was merely pointing out that former-something means they hold a grudge against that something, hence not actually to be taken as an example of some kind of neutrality.

It's like asking Talibans what they thought of USA when they financed them and after they invaded their country and bombed their villages.

With the difference that no communist ever harmed Sowell.

> As once-Marxist economist Thomas Sowell put it: great idea, wrong species.

I'm not sure how fair it is to describe Thomas Sowell as a once-Marxist economist. He spent until he was 30 being Marxist, but then the next 50 years of his life being incredibly well-known as a fairly pro-Capitalist economist.

Don't get me wrong - I'm a huge fan of his. I'm just not sure this is a fair characterization of him :)

I'm not interested in defending specific examples of communism. My point was that it's not part of the underlying ideology, hence "inherently". Whereas hatred of jews is a core part of nazism
Which communism, the one in reality or the one in theory?
I think this distinction is worth mentioning whenever the comparison with fascism comes up. There is communist philosophy that we can discuss or joke about like OP that is somewhat disconnected from the brutal historical reality. This is not possible with fascism which is purely political (there are pretty much no fascist philosophical works).
Lol, the Red Guards certainly weren't beating their teachers to death out of love.
(comment deleted)
Please don't do this here.
Communists hate capitalists and the wealthy. Communism is inherently selfish, since it is about taking from others for oneself (and sharing with fellow selfish individuals who collectively enable the taking from others). Communism is built, not on compassion for the working class, but on resentment of the rich elite.

If communism wasn't hateful and selfish, then it would look a lot more like christianity: freedom + sacrificial charitable giving.

Tell that to those nations which lost large percentage of their population to communist terror.
> Nazi purges kill all minorities.

That’s not actually true. Traditional ethnic minorities in Northern Germany include the Danes and the Frisians. How did the Nazis treat them? Well, the Nazis viewed them as fellow “Aryans”. If the Nazis persecuted them at all, I can’t find any information on it.

The Nazis were not equally anti all minorities. In their minds, there was a ranking of the minorities, those at the top were to be treated with mildness, those at the bottom were to be completely extinguished by mass murder.

The idea that Nazis treated all minorities equally is arguably disrespectful (even if only unintentionally) of those whom the Nazis treated the worst.

This is unecessarily pedantic
I'm not sure comparing them like this really makes sense. There were/are hundreds if not more different movements who consider themselves communist and that have (often radically) different ideas on what communism actually is. National socialism is a single party ideology and that party was only in power for a few years in a single country. Just like with communism there are/were many more "benign" far right or fascist movements.
Marx was extremely pro-violence, and would call you a utopian.
well I'm not a communist, I just think comparing nazism to communism as an ideology is letting it off easy
That’s an understandable position. Still, one ought not ignore the embarrassing (for some) similarities between the two.

I’m partial to interpretations which treat the Twentieth Century megadeaths, and subsequent rise of the contemporary, technological society as a unitary problem.

Please don't take HN threads further into generic ideological flamewar. It's repetitive, tedious, and hellish.

https://news.ycombinator.com/newsguidelines.html

Well, it wasn't my intention. My point was really more of a condemnation of nazism rather than a defense of communism, I wasn't expecting such strong reactions. I'm a german and all I was trying to say is that the comparison falls flat because nazism is an ideology with an explicit foundation of hate.
I did find this funny, and then I thought "Would I still find this funny if it was `import capitalism`?
Be careful with fundamental framework imports, some of them may fetch `armed_conflict` as a dependency. It is known for numerous undefined behaviors, which may corrupt your logic (fragile base class problem) and make it non-functional.
I guess `import fascism` would be still fine
Free speech protects you from the state, not from private companies. You can declare yourself to be anything you'd like, but you may suffer the consequences.
Please don't start ideological flamewars on HN. They're repetitive, and they always turn nasty.

The wretched descent into offtopic hell that we got in this case is an example of what we're trying to avoid.

https://news.ycombinator.com/newsguidelines.html

When 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.

As 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
Talk to your kids before they learn about Rust.
Communism is not just classless, but also stateless. Therefore, Python cannot be communist, because it is not a purely functional language.
Statelessness is communism’s endgame which it never actually archives.
> 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!

Classless 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…

Why 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.
I 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?