We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if 0: class T:...
SyntaxError: expected an expression, got class
context blocks: "as" label: pocketpy#187
def iteration(): yield 1 yield 2 N = iteration() while next(N, None): pass
TypeError: expected 1 arguments, got 2
FIX:
__next__ = next def next(it, default=0xdeadbeef): itrv = __next__(it) if itrv == StopIteration: if default == 0xdeadbeef: raise itrv return default return itrv __import__('builtins').next = next
def NEXT(it, default=StopIteration): pass
SyntaxError: default argument must be a literal
enumerate(())
SyntaxError: expected an expression, got )
while 1: break else: print('while-else') Traceback (most recent call last):
std::exception: invalid jump
for _ in range(1): while 1: break else: continue print('while-else')
class dlproxy(object): def __init__(self, *argv, **env): self.__dlref = " ".join(map(str, argv)) self.__lastc = "__init__" self.__serial = 0 def __call__(self, callid, fn, *argv, **env): stack : list = [ callid, fn , argv, env ] print(f"{self.__dlref}.{fn}({argv},{env}) {callid=}") def __all(self, *argv, **env): self.__serial += 1 return self.__call__(f"C{self.__serial}", self.__lastc, *argv, **env) def __getattr__(self, attr): self.__lastc = attr return self.__all lib = dlproxy('lib') lib.trap(1,2,3,key='value')
AttributeError: 'dlproxy' object has no attribute 'trap
FIX
attr = "trap" argv = (1,2,3) kw = {"key":'value'} try: getattr(lib, attr)(*argv, **kw) except AttributeError: lib.__getattr__(attr)(*argv, **kw) del attr, argv, kw
def loc(a,b='b',c="c",**kw): print( locals()) loc("a")
NameError: name 'locals' is not defined
The text was updated successfully, but these errors were encountered:
split / rsplit implementations fake.
Sorry, something went wrong.
No branches or pull requests
SyntaxError: expected an expression, got class
context blocks: "as" label: pocketpy#187
TypeError: expected 1 arguments, got 2
FIX:
SyntaxError: default argument must be a literal
enumerate(())
SyntaxError: expected an expression, got )
std::exception: invalid jump
FIX:
AttributeError: 'dlproxy' object has no attribute 'trap
FIX
NameError: name 'locals' is not defined
The text was updated successfully, but these errors were encountered: