This repository was archived by the owner on Sep 8, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,17 @@ def stack_push_int(self) -> Callable[[int], None]:
324324 @cached_property
325325 def stack_push_bytes (self ) -> Callable [[bytes ], None ]:
326326 return self ._stack .push_bytes
327+
328+ #
329+ # Return Stack Management
330+ #
331+ @cached_property
332+ def rstack_push_int (self ) -> Callable [[int ], None ]:
333+ return self ._rstack .push_int
334+
335+ @cached_property
336+ def rstack_pop1_int (self ) -> Callable [[int ]], None ]:
337+ return self ._rstack .pop1_int
327338
328339 #
329340 # Computation result
Original file line number Diff line number Diff line change 2323For the same reason, the class RStack doesn't inherit from the abc StackAPI, as it would require to implement all the abstract methods defined.
2424"""
2525
26+
27+ def _busted_type (item_type : type , value : Union [int , bytes ]) -> ValidationError :
28+ return ValidationError (
29+ "Stack must always be bytes or int, "
30+ f"got { item_type !r} type, val { value !r} "
31+ )
32+
2633class RStack ():
2734 """
2835 VM Return Stack
@@ -46,7 +53,7 @@ def push_int(self) -> int:
4653 self ._append ((int , value ))
4754
4855
49- def pop1_int (self ) -> int :
56+ def pop1_int (self ) -> int :
5057 #
5158 # Note: This function is optimized for speed over readability.
5259 #
@@ -61,10 +68,3 @@ def pop1_int(self) -> int:
6168 else :
6269 raise _busted_type (item_type , popped )
6370
64- def _busted_type (item_type : type , value : Union [int , bytes ]) -> ValidationError :
65- return ValidationError (
66- "Stack must always be bytes or int, "
67- f"got { item_type !r} type, val { value !r} "
68- )
69-
70-
You can’t perform that action at this time.
0 commit comments