[Typing] mypy complains if we pass a custom type to `bloq.call_classically()`

Open
#1,623 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating the definition of ClassicalValT and the bloq.call_classically() method, then review the tests in pull request #1622 for the custom types being passed. Determine how the type annotation can accept those values, and verify that mypy accepts the affected calls without the arg-type ignore.

Written by the indexing model from the issue text.

Description

area/devops no QC knowledge needed

We've recently added QGF and QGFPoly classes to the quantum data types. As a result, we want to pass instances of custom types (eg: galois.Poly) as parameters to bloq.call_classically() method. On doing this, mypy complains with a arg-type error since definition of ClassicalValT is restrictive.

For now, I'm adding # type: ignore[arg-type] to unblock development, but someone should go and fix this. For example, see tests in https://github.com/quantumlib/Qualtran/pull/1622

Dominant language
Python
Stars
397
Forks
127
Avg merge
2d 22h
Merged PRs (30d)
1

Getting set up

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.

More from quantumlib/Qualtran

All issues in quantumlib/Qualtran

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.