Skip to content

Commit

Permalink
fix: Use panicking division ops
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Nov 6, 2023
1 parent 51cff54 commit b13c9b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
16 changes: 5 additions & 11 deletions guppy/prelude/integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ def __ceil__(self: int) -> int:
...


@extension.func(
OpCompiler(ops.DummyOp(name="idivmod_s_panic")), instance=IntType # TODO
)
@extension.func(OpCompiler(IntOpCompiler("idivmod_s", num_params=2)), instance=IntType)
def __divmod__(self: int, other: int) -> tuple[int, int]:
...

Expand All @@ -104,7 +102,7 @@ def __floor__(self: int, other: int) -> int:
...


@extension.func(OpCompiler(ops.DummyOp(name="idiv_s_panic")), instance=IntType) # TODO
@extension.func(IntOpCompiler("idiv_s", num_params=2), instance=IntType)
def __floordiv__(self: int, other: int) -> int:
...

Expand Down Expand Up @@ -146,7 +144,7 @@ def __lt__(self: int, other: int) -> bool:
...


@extension.func(OpCompiler(ops.DummyOp(name="imod_s_panic")), instance=IntType) # TODO
@extension.func(IntOpCompiler("imod_s", num_params=2), instance=IntType)
def __mod__(self: int, other: int) -> int:
...

Expand Down Expand Up @@ -191,16 +189,12 @@ def __rand__(self: int, other: int) -> int:
...


@extension.func(
Reversed(OpCompiler(ops.DummyOp(name="idivmod_s_panic"))), instance=IntType # TODO
)
@extension.func(Reversed(IntOpCompiler("idivmod_s", num_params=2)), instance=IntType)
def __rdivmod__(self: int, other: int) -> int:
...


@extension.func(
Reversed(OpCompiler(ops.DummyOp(name="idiv_s_panic"))), instance=IntType # TODO
)
@extension.func(Reversed(IntOpCompiler("idiv_s", num_params=2)), instance=IntType)
def __rfloordiv__(self: int, other: int) -> int:
...

Expand Down
2 changes: 1 addition & 1 deletion validator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion validator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.19.0"
quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr.git", rev = "46d50176c3bb7589ef8349a31d6801d45c3313b9" }
quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr.git", rev = "1a07cd9aca60aa75257bdb297d7442d9529765fb" }
rmp-serde = "1.1.1"
lazy_static = "1.4.0"

0 comments on commit b13c9b4

Please sign in to comment.