Quantinuum / Quantinuum/guppy-docs

Python builtin types clash with Guppy builtin types in Sphinx cross-references

Open
#47 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Markdown
Stars
3
Forks
3
Avg merge
23h 22m
Merged PRs (30d)
11

Description

Python has builtin types for its most primitive data, e.g. str, bool, int and so on. Guppy has some too, and they share the same name, but are not exactly the same. Most of the time, functions that construct Guppy code want to accept the Python variant.

When the Sphinx doc is built, the generated links on the type annotations (e.g. on the @guppy decorator page) do not point to the Python builtin (like they do on https://www.sphinx-doc.org/en/master/usage/domains/python.html#python-signatures for example), but instead point to the Guppy definition:

Image

Since we already define the intersphinx mapping for python:, we shall use python:int and similar to mitigate this in all places.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the Sphinx documentation sources for type annotations on the @guppy decorator page and other builtin-type references, then inspect the existing intersphinx mapping for python:. Confirm completion by rebuilding the docs and checking that links for str, bool, int, and similar annotations resolve to Python’s builtin definitions rather than Guppy definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.