[ create a new paste ] login | about

Link: http://codepad.org/qqXowiyx    [ raw code | output | fork ]

shemigon - Python, pasted on Jun 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sys

print "Version: %d.%d.%d\n" % sys.version_info[:3]

string_params = {'a':1, 'b': 2}
unicode_params = {u'a':1, u'b': 2}

def f(a,b):
 print "params: ", a, b

print "Run with string params:"
f(**string_params)

print "\nRun with unicode params:"
f(**unicode_params)


Output:
1
2
3
4
5
6
7
8
9
10
Version: 2.5.1

Run with string params:
params:  1 2

Run with unicode params:
Traceback (most recent call last):
  Line 15, in <module>
    f(**unicode_params)
TypeError: f() keywords must be strings


Create a new paste based on this one


Comments: