Skip to content

Commit 3d30769

Browse files
tcoratgerclaude
andauthored
style(slot): use future annotations and unquote self-references (#1140)
The slot module is not a Pydantic model: Slot is a plain Uint64 (int) subclass, so the project prohibition on future annotations in Pydantic files does not apply here. Add the future import and unquote the now-unnecessary self-referential annotations. Behavior is identical; just check passes. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e9fd199 commit 3d30769

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/lean_spec/spec/forks/lstar

src/lean_spec/spec/forks/lstar/slot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Slot primitive shared by the consensus and crypto layers."""
22

3+
from __future__ import annotations
4+
35
import math
46
from typing import Final
57

@@ -12,7 +14,7 @@
1214
class Slot(Uint64):
1315
"""A slot number, as a 64-bit unsigned integer."""
1416

15-
def justified_index_after(self, finalized_slot: "Slot") -> int | None:
17+
def justified_index_after(self, finalized_slot: Slot) -> int | None:
1618
"""
1719
Return the relative bitfield index for justification tracking.
1820
@@ -25,7 +27,7 @@ def justified_index_after(self, finalized_slot: "Slot") -> int | None:
2527
# Slot (finalized_slot + 1) maps to index 0.
2628
return int(self - finalized_slot) - 1
2729

28-
def is_justifiable_after(self, finalized_slot: "Slot") -> bool:
30+
def is_justifiable_after(self, finalized_slot: Slot) -> bool:
2931
"""
3032
Whether this slot is a valid justification candidate after a given finalized slot.
3133

0 commit comments

Comments
 (0)