style fixes

This commit is contained in:
Paul Tagliamonte 2013-06-08 20:10:27 -04:00
parent 12abef5ed5
commit d15aa31a32

View File

@ -57,20 +57,25 @@ def _wrap_value(x):
else: else:
return wrapper(x) return wrapper(x)
_wrappers = {int: HyInteger, _wrappers = {
int: HyInteger,
bool: lambda x: HySymbol("True") if x else HySymbol("False"), bool: lambda x: HySymbol("True") if x else HySymbol("False"),
float: HyFloat, float: HyFloat,
complex: HyComplex, complex: HyComplex,
str_type: HyString, str_type: HyString,
dict: lambda d: HyDict(_wrap_value(x) for x in sum(d.items(), ())), dict: lambda d: HyDict(_wrap_value(x) for x in sum(d.items(), ())),
list: lambda l: HyList(_wrap_value(x) for x in l)} list: lambda l: HyList(_wrap_value(x) for x in l)
}
def process(tree, module_name): def process(tree, module_name):
if isinstance(tree, HyExpression): if isinstance(tree, HyExpression):
fn = tree[0] fn = tree[0]
if fn in ("quote", "quasiquote"): if fn in ("quote", "quasiquote"):
return tree return tree
ntree = HyExpression([fn] + [process(x, module_name) for x in tree[1:]]) ntree = HyExpression(
[fn] + [process(x, module_name) for x in tree[1:]]
)
ntree.replace(tree) ntree.replace(tree)
if isinstance(fn, HyString): if isinstance(fn, HyString):