Re: pickle handling multiple objects ..

2012-02-27 Thread Ian Kelly
On Sun, Feb 26, 2012 at 6:00 AM, Chris Angelico wrote: > Additionally, you'll get a weird crash out of your program if load() > returns something other than a sequence of length 3. Remember, > everything that comes from outside your code is untrusted, even if you > think you made it just two secon

Re: pickle handling multiple objects ..

2012-02-27 Thread 88888 Dihedral
在 2012年2月26日星期日UTC+8下午9时00分31秒,Chris Angelico写道: > On Sun, Feb 26, 2012 at 11:04 PM, Peter Otten <__pete...@web.de> wrote: > > This is however a bit errorprone. If you accidentally write the loading code > > as > > > > fruit, beverages, vegetables = pickle.load(f) > > > > you'll end up drinking pot

Re: pickle handling multiple objects ..

2012-02-26 Thread Chris Angelico
On Sun, Feb 26, 2012 at 11:04 PM, Peter Otten <__pete...@web.de> wrote: > This is however a bit errorprone. If you accidentally write the loading code > as > > fruit, beverages, vegetables = pickle.load(f) > > you'll end up drinking potatoes. You mean vodka? :) Additionally, you'll get a weird cr

Re: pickle handling multiple objects ..

2012-02-26 Thread Peter Otten
Smiley 4321 wrote: > If I have a sample python code to be executed on Linux. How should I > handle multiple objects with 'pickle' as below - > > --- > #!/usr/bin/python > > import pickle > > #my_list = {'a': 'Apple', 'b': 'Mango', 'c': 'Orange', 'd': 'Pineapple'} > #my_list = ('Apple', 'Ma

Re: pickle handling multiple objects ..

2012-02-26 Thread Chris Rebert
On Sun, Feb 26, 2012 at 3:25 AM, Smiley 4321 wrote: > If I have a sample python code to be executed on Linux. How should  I handle > multiple objects with 'pickle' as below - > > --- > #!/usr/bin/python > > import pickle > > #my_list = {'a': 'Apple', 'b': 'Mango', 'c': 'Orange', 'd': 'Pineappl