Return a string result with out breaking loop

cnb circularfunc at yahoo.se
Mon Aug 25 21:58:56 EDT 2008


ok post exactly what you do when this hapens:
ault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal <type
'generator'
 > objects">

it complains you are trying to marshal a generator object rather than
the file you are yielding.



also, something I am not sure about:

>>> def f(x):
	try: open("C:/ruby/progs/blandat/infixtoprefix.rb") or open(str(x))
	except:print "hello"


>>> f(12)
>>> def f(x):
	try: (open(str(x)) or open("C:/ruby/progs/blandat/infixtoprefix.rb"))
	except:print "hello"


>>> f(12)
hello
>>>

the or doesnt seem to work as expected. but thats not the problem youa
re experienceing



More information about the Python-list mailing list