quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.24k stars 1.01k forks source link

Write test to detect unescaped double-underscore and single-underscore values in docstrings #1189

Open Strilanc opened 5 years ago

Strilanc commented 5 years ago

These are almost always intended to refer to magic methods, but markdown/rst/etc interpret it as emphasis and remove the underscores. We should detect that this is happening and raise errors.

dabacon commented 4 years ago

An example can be found in https://cirq.readthedocs.io/en/stable/generated/cirq.phase_by.html where we see an un-escaped _phased_by_

balopat commented 4 years ago

As we're retiring sphinx, the work here is to check this behavior in devsite.

dabacon commented 2 years ago

Still relevant, as there are places with docstrings that have unescaped _dunder_ methods that render strangely.

angelo-laskaris commented 7 months ago

Ill take the issue