1.1 --- a/lib/builtins.py Tue Nov 14 23:41:45 2006 +0100
1.2 +++ b/lib/builtins.py Tue Nov 14 23:42:21 2006 +0100
1.3 @@ -448,7 +448,10 @@
1.4 def __true__(self):
1.5 return self != 0
1.6
1.7 -class string:
1.8 +class str:
1.9 + def __init__(self, x=None):
1.10 + x.__str__()
1.11 +
1.12 def __add__(self, other):
1.13 if isinstance(other, string):
1.14 return string()
1.15 @@ -798,9 +801,6 @@
1.16 i -= 1
1.17 return result
1.18
1.19 -def str(x):
1.20 - return x.__str__()
1.21 -
1.22 # Special values. None of these definitions should be generated by the compiler.
1.23 # All such definitions should be made in the underlying implementation.
1.24
2.1 --- a/tests/logical.py Tue Nov 14 23:41:45 2006 +0100
2.2 +++ b/tests/logical.py Tue Nov 14 23:42:21 2006 +0100
2.3 @@ -1,1 +1,5 @@
2.4 +x = 1
2.5 +y = "2"
2.6 +b = 3.0
2.7 +c = 4
2.8 a = x and y or b and not c
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tests/logical_attr.py Tue Nov 14 23:42:21 2006 +0100
3.3 @@ -0,0 +1,10 @@
3.4 +class X:
3.5 + x = 1
3.6 +class Y:
3.7 + y = "2"
3.8 +class B:
3.9 + b = 3.0
3.10 +class C:
3.11 + c = 4
3.12 +a = X() and Y() or B() and not C()
3.13 +b = a.x and a.y or a.b and not a.c