Python 3.5 kw arg can be an expr

Fixes Issue #95
This commit is contained in:
rocky
2017-05-14 11:41:12 -04:00
parent 2a7a166696
commit 47977b3372
3 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# sql/schema.py
def tometadata(self, metadata, schema, Table, args, name=None):
table = Table(
name, metadata, schema=schema,
*args, **self.kwargs
)
return table

View File

@@ -483,6 +483,8 @@ class Python3Parser(PythonParser):
# high byte number of positional parameters
args_pos = token.attr & 0xff
args_kw = (token.attr >> 8) & 0xff
args_kw = (token.attr >> 8) & 0xff
# args_ann = (token.attr >> 16) & 0x7FFF
# Additional exprs for * and ** args:
# 0 if neither
@@ -498,7 +500,7 @@ class Python3Parser(PythonParser):
# first LOAD_FAST, below are located.
# Python 3.6+ replaces CALL_FUNCTION_VAR_KW with CALL_FUNCTION_EX
if opname.endswith('KW'):
kw = 'LOAD_FAST '
kw = 'expr '
else:
kw = ''
rule = ('call_function ::= expr expr ' +