Skip to content

Commit

Permalink
Change return type of CircuitRepeatBlock.name to str (#783)
Browse files Browse the repository at this point in the history
The correct return type for this method should be `str` as the
documentation guarantees that this specific method returns `"REPEAT"`.

Derived from #777

Fixes #776

---------

Co-authored-by: Adrien Suau <[email protected]>
  • Loading branch information
Strilanc and nelimee authored Jun 11, 2024
1 parent 320288c commit 2b3b645
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/python_api_reference_vDev.md
Original file line number Diff line number Diff line change
Expand Up @@ -3797,7 +3797,7 @@ def body_copy(
@property
def name(
self,
) -> object:
) -> str:
"""Returns the name "REPEAT".
This is a duck-typing convenience method. It exists so that code that doesn't
Expand Down
2 changes: 1 addition & 1 deletion doc/stim.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ class CircuitRepeatBlock:
@property
def name(
self,
) -> object:
) -> str:
"""Returns the name "REPEAT".
This is a duck-typing convenience method. It exists so that code that doesn't
Expand Down
2 changes: 1 addition & 1 deletion glue/python/src/stim/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ class CircuitRepeatBlock:
@property
def name(
self,
) -> object:
) -> str:
"""Returns the name "REPEAT".
This is a duck-typing convenience method. It exists so that code that doesn't
Expand Down
2 changes: 1 addition & 1 deletion src/stim/circuit/circuit_repeat_block.pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void stim_pybind::pybind_circuit_repeat_block_methods(pybind11::module &m, pybin

c.def_property_readonly(
"name",
[](const CircuitRepeatBlock &self) -> pybind11::object {
[](const CircuitRepeatBlock &self) -> pybind11::str {
return pybind11::cast("REPEAT");
},
clean_doc_string(R"DOC(
Expand Down

0 comments on commit 2b3b645

Please sign in to comment.