There’s a new biopic of Alan Turing out this week. It’s called The Imitation Game and stars Benedict Cumberbatch as Turing, the genius computer scientist, cryptologist, and mathematician who is often credited with pioneering the modern idea of a computer, and also played a significant part in winning World War II through his work on decrypting German communications. For his trouble, he was prosecuted in 1952 for “gross indecency” — he was carrying on an affair with a man, which was illegal at the time. He pled guilty, was chemically castrated… and died, apparently by his own hand, barely two years later. The biopic is part of a resurgence of interest in Turing’s story; he was given a long-overdue posthumous pardon by the Queen of England last year, and his life and work have also been explored in George Dyson’s excellent book Turing’s Cathedral and in the recent documentary film Codebreaker.

The story of Turing’s treatment is often presented these days as an example of How Far We’ve Come: we live in a society where LGBT rights have advanced immeasurably, so much so that it’s startling to think that it was barely 60 years ago that Turing was being prosecuted and castrated for his sexual orientation. There are obviously still parts of the world where LGBT people are subjected to horrifying oppression, and there’s clearly some distance to go even in ostensibly tolerant societies like this one, but still, the level of ignorance about the spectrum of human sexuality is still significantly lower than it was in Turing’s day— or, at least, so we like to think.

It’s worth examining the circumstances of Turing’s case a bit more closely, though, because they reflect attitudes that remain pervasive in our society. Specifically, they represent ideas of gender essentialism that are still very much alive and well in 2014.

It’s startling to think this, because the details of Turing’s punishment sound downright barbaric. The phrase “chemical castration” seems to come from another age, one of lobotomies and electroshock therapy and insulin comas. You might be surprised to know, then, that it’s actually still very much a thing today. It’s used in several US states, throughout Europe, and in various other places around the world. These days, it’s generally used as a treatment for recidivist sex offenders, and also in the treatment of hormone-dependent cancers.

So, how is it done? The drugs used are antiandrogens, usually progesterone, which inhibit androgens from operating within the body. And what are androgens, you might ask? They’re male sex hormones, basically — the chemicals that promote and regulate male characteristics in the human body. The best-known is testosterone; others include dihydrotestosterone and androstenedione. Antiandrogens inhibit the production of androgens and/or their uptake by androgen receptors.

In Turing’s day, the treatment was still very much an experimental one, and instead of progesterone, he was given a synthetic estrogen. But according to Andrew Hodges’ excellent biography Alan Turing: The Enigma, the first experiments in chemical castration involved injecting men with testosterone.

To modern readers, this appears counterintuitive — of course injecting gay men with testosterone isn’t going to decrease their sex drive! To the thinking of Turing’s day, though, it made perfect sense, because that thinking started from the premise that, in Hodges’ words, “[psychology] was dominated by the categories of ‘masculine’ and ‘feminine,’ with a belief that gay men and lesbian women had been endowed by nature with an unusual mixture of these all-important characteristics.”

This point of view starts from an assumption that heterosexuality is “normal,” and thus being attracted to men is an inherently “female” characteristic. In theory, then, its suppression should come from an increase in the hormone that promotes male sexual characteristics, right?

Wrong! According to Hodges, the initial experiment with testosterone was a disaster: of the 11 men injected with testosterone, “only three … reported benefit from this therapy. Five reported an intensification of the homosexual drive.” Whoops! It turned out that making men more manly was the complete opposite of what needed to be done; instead, chemical castration actually functions by inhibiting the effect of androgens, rather than boosting them. And it doesn’t change the nature of sexual desire in the slightest; it works by banishing the sex drive of the person undergoing treatment.

On face value, this would seem nevertheless to support the idea that sex and sexuality are inextricable, that there’s a direct causal link between sex hormones and the nature of sexual desire. In some ways, this is true: you don’t choose your sexual orientation any more than you choose any other aspect of your psyche. But it also indicates that gender and sexuality come from very different places.

To a Turing-era psychologist, a revised theory might go like this: well, OK, progesterone and estrogen are “female” hormones, and men are generally more interested in sex than women — so give female hormones to men, and their sex drive goes away. Only, it’s not that simple: estrogen and progesterone are pretty much polar opposites in their functions in the female body. Their relative levels regulate the menstrual cycle, and the former seems to increase a woman’s sex drive while the latter suppresses it. But in men, they both seem to reduce sexual drive. Conversely, men with an overabundance of androgens (for example, because of the consumption of steroids) tend to have a higher sex drive. However, such men also tend to develop higher levels of estradiol — a form of estrogen, basically — leading to the development of female physical characteristics (most notably, growing breasts).

All any of this does is go to show is that gender, sex, and sexual orientation are three different things, each existing and being regulated independently of one another. They clearly interact, but the more you look into how they do so, the more you realize the folly of trying to ascribe aspects of gender and orientation to the nature of physical sex identity.

Gender, as Judith Butler famously wrote, “is a performance.” So too, in this respect, is sexual orientation — not in that it’s a choice that can be made, as bigots sometimes like to argue, but in that it’s an aspect of the personality that exists independent of gender and sex. Indeed, it seems to be unaffected by changes in either of those characteristics — the sexual orientation of trans men and women, for instance, is almost never affected by their physical transition. (Even where this does seem to be the case, it may well be, as psychotherapist Ami Kaplan argues, “perhaps what is really happening in these cases is that individuals are choosing partners more for the complex array of factors that help the individual feel confirmed in their authentically felt gender rather than for their desirability based on their maleness or femaleness.”)

All of which is to say that gender essentialism is one of those beliefs that is still generally accepted as an unquestioned intuition: men and women are different, right? Men are from Mars, women are from Venus, and all that? And sure, humans are clearly sexually dimorphic. Beyond that, though, essentialism is one of those agreed-upon notions that start to disintegrate the minute you start to scrutinize them.

Turing’s case is a salutary example of what happens when one proceeds without questioning one’s assumptions. It was accepted as fact in the 1950s that heterosexuality was normal, that homosexuality was a condition to be cured, and that both of these things were related to the nature of one’s gender. When these assumptions were extrapolated into policy, the result was the dreadful mistreatment of a man who deserved far better. Turing’s legacy is in the field of science, and his treatment is a reminder of what the scientific method teaches us: question everything.