From 56dedfa6eda4afd63a079ca884d864c06793ee0e Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Tue, 8 Jan 2013 22:52:04 -0500 Subject: [PATCH] Playing around... --- hy/compiler/ast27.py | 2 +- hy/lang/string.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hy/compiler/ast27.py b/hy/compiler/ast27.py index c4faa28..9cec38e 100644 --- a/hy/compiler/ast27.py +++ b/hy/compiler/ast27.py @@ -343,7 +343,7 @@ class AST27Converter(object): def render_bool(self, node): """ Render a boolean to AST """ - thing = "True" if node else "False" + thing = "True" if node._val else "False" return ast.Name(id=thing, ctx=ast.Load()) def render_symbol(self, node): diff --git a/hy/lang/string.py b/hy/lang/string.py index 13d2d29..7f90ece 100644 --- a/hy/lang/string.py +++ b/hy/lang/string.py @@ -9,8 +9,9 @@ else: class HYString(HYObject, _str_type): - def __init__(self, string): - self += string + def __new__(cls, value): + obj = _str_type.__new__(cls, value) + return obj def eval(self, ln, *args, **kwargs): return str(self)