Walk me through how you think this is going to be enforced? Athletes will need to start dropping their pants? Disgusting invasion of privacy.

The article addresses that. Given all the testing already, this is a trivial addition:

“Under the new policy eligibility will be determined by a one-time gene test, according to the I.O.C. The test, which is already being used in track and field, requires screening via saliva, a cheek swab or a blood sample.“

[dead]

You think Olympic athletes have any expectation of privacy around drug testing already? They have to register their every move and piss while being visible on demand.

You think the only way to medically test for male vs female is to visually id genitals?

Well the article says a cheek swab or blood test.

The article already covered it: It's minimally invasive (cheek swab) testing typically for the SRY gene - https://en.wikipedia.org/wiki/Sex-determining_region_Y_prote...

This is less invasive than all of the other doping tests that athletes already go through, which require blood draws.

Doesn’t really work though - and given athletes are on the edge of performance there’s probably more people that fall in between than you might expect

From the Wikipedia article:

While the presence or absence of SRY has generally determined whether or not testis development occurs, it has been suggested that there are other factors that affect the functionality of SRY.[25] Therefore, there are individuals who have the SRY gene, but still develop as females, either because the gene itself is defective or mutated, or because one of the contributing factors is defective.[26] This can happen in individuals exhibiting a XY, XXY, or XX SRY-positive[27] karyotype[better source needed] Additionally, other sex determining systems that rely on SRY beyond XY are the processes that come after SRY is present or absent in the development of an embryo. In a normal system, if SRY is present for XY, SRY will activate the medulla to develop gonads into testes. Testosterone will then be produced and initiate the development of other male sexual characteristics. Comparably, if SRY is not present for XX, there will be a lack of the SRY based on no Y chromosome. The lack of SRY will allow the cortex of embryonic gonads to develop into ovaries, which will then produce estrogen, and lead to the development of other female sexual characteristics.[28]

The IOC included exceptions for certain DSDs.

Please read the linked articles first before jumping to Wikipedia to try to counter them. The decision is more nuanced than you assume

The Yahoo article linked says that exceptions will be made for people with conditions like that:

“Athletes diagnosed with Complete Androgen Insensitivity Syndrome (CAIS) ‘or other rare differences/disorders in sex development (DSDs), who do not benefit from the anabolic and/or performance-enhancing effects of testosterone’ may still be allowed to participate in the women’s category.”

[deleted]

In a word: so? Intersex people exist, you have to draw the line somewhere, the presence of SRY seems as good as any.

The test is used for initial screening only.

Presence of SRY in an athlete registered as female means further tests must be undertaken, with permission of the athlete, to determine eligibility.

Absence of SRY means the screening is passed and the athlete is eligible to compete.