quantumlib / Cirq

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

API documentation drops type hints. #4657

Open dabacon opened 2 years ago

dabacon commented 2 years ago

Description of the issue

See for example API documentation for on_each in Gate image But the signature was

def on_each(self, *targets: Union[Qid, Iterable[Any]]) -> List['cirq.Operation']:

A quick glance at this makes me think it is the non-forward reference....ones that are labeled like 'cirq.Qid' seem to show up.

daxfohl commented 2 years ago

Actually it seems to be the varargs format. In https://quantumai.google/reference/python/cirq/circuits/CircuitOperations there are plenty of forward references that work, but with_qubits is broken even though annotated correctly.