Skip to content

Instantly share code, notes, and snippets.

Created Aug 3, 2021
What would you like to do?
Testing the implicits library (works well btw)
from implicits import implicits
def pop(stack, n=1, *, ctx):
ret = [stack.pop() for i in range(n)]
if ctx.reverse_arguments: ret = ret[::-1]
return ret
# Simulate
from implicits import implicits
import elements
class Context:
def __init__(self):
self.reverse_arguments = False
ctx = Context()
ctx.reverse_arguments = False
lst = [1, 2, 3, 4]
x = elements.pop(lst, 2)
print(x, lst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment