I was looking into currying and
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
Type "copyright" , "credits" or "license()" for more information.
*************** *************** *************** *************** ****
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
*************** *************** *************** *************** ****
IDLE 1.2.2
'aja bajae'
'aja bajaea'
'foo'
'foo'
True
35018400
35018400
(35110112, 'foobar')
(35018400, 'foo')
Traceback (most recent call last):
File "<pyshell#1 4>", line 1, in <module>
fac
NameError: name 'fac' is not defined
Traceback (most recent call last):
File "<pyshell#1 5>", line 1, in <module>
factorial
NameError: name 'factorial' is not defined
<module 'math' (built-in)>
Traceback (most recent call last):
File "<pyshell#1 8>", line 1, in <module>
math.factorial
AttributeError: 'module' object has no attribute 'factorial'
Traceback (most recent call last):
File "<pyshell#1 9>", line 1, in <module>
math.fac
AttributeError: 'module' object has no attribute 'fac'
['__doc__', '__name__', 'acos', 'asin', 'atan', 'atan2', 'ceil',
'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'floor', 'fmod',
'frexp', 'hypot', 'ldexp', 'log', 'log10', 'modf', 'pi', 'pow',
'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh']
<built-in function pow>
Traceback (most recent call last):
File "<pyshell#2 2>", line 1, in <module>
tan
NameError: name 'tan' is not defined
<built-in function tan>
return a+b
(5, 4)
a=x+y
return a
9
return n + p
11
return n+p
7
return a+b
Traceback (most recent call last):
File "<pyshell#4 4>", line 1, in <module>
build(5,4)
File "<pyshell#4 3>", line 2, in build
return a+b
TypeError: cannot concatenate 'str' and 'function' objects
yreturn x+
SyntaxError: invalid syntax
return x+y
9
return a+b
9
wtf was this in the middle!?
return a+b
(5, 4)
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
Type "copyright" , "credits" or "license()" for more information.
*************** *************** *************** *************** ****
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
*************** *************** *************** *************** ****
IDLE 1.2.2
>>h = "aja baja"
>>h += 'e'
>>h
>>h += 'e'
>>h
>>h = h+'a'
>>h
>>h
>>a = b = "foo"
>>a
>>a
>>b
>>a==b
>>id(a)
>>id(b)
>>a += "bar"
>>id(a),a
>>id(a),a
>>id(b),b
>>fac
File "<pyshell#1 4>", line 1, in <module>
fac
NameError: name 'fac' is not defined
>>factorial
File "<pyshell#1 5>", line 1, in <module>
factorial
NameError: name 'factorial' is not defined
>>import math
>>math
>>math
>>math.factoria l
File "<pyshell#1 8>", line 1, in <module>
math.factorial
AttributeError: 'module' object has no attribute 'factorial'
>>math.fac
File "<pyshell#1 9>", line 1, in <module>
math.fac
AttributeError: 'module' object has no attribute 'fac'
>>dir(math)
'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'floor', 'fmod',
'frexp', 'hypot', 'ldexp', 'log', 'log10', 'modf', 'pi', 'pow',
'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh']
>>pow
>>tan
File "<pyshell#2 2>", line 1, in <module>
tan
NameError: name 'tan' is not defined
>>math.tan
>>def build(a,b):
>>build(5,4)
>>def build(x,y):
return a
>>build(5,4)
>>def b(n, p):
>>b(1, 10)
>>def b(n,p):
>>b(5,2)
>>def build(x,y):
>>build(5,4)
File "<pyshell#4 4>", line 1, in <module>
build(5,4)
File "<pyshell#4 3>", line 2, in build
return a+b
TypeError: cannot concatenate 'str' and 'function' objects
>>def build(x,y):
SyntaxError: invalid syntax
>>def build(x,y):
>>build(5,4)
>>def build(a,b):
>>build(5,4)
>>>
wtf was this in the middle!?
>>def build(a,b):
>>build(5,4)
Comment