Surya Kasturi於 2013年4月2日星期二UTC+8下午10時54分25秒寫道:
> Hi, hope you can help me on it..
> 
> 
> 
> with open(pickle_f, 'r') as fhand:
>         obj = pickle.load(fhand)
> 
> 
> 
> 
> This works on linux but not in windows until  I use "rb" mode while creating 
> file object. Surprisingly, the "rb" mode is not working on Linux.. raising 
> EOFError.
> 
Just use a decorator with a pass in parameter about the OS
to wrap the two versions in different platforms.

By the way any function can be saved in a variable  to 
be passed around means that the lambda 1-liner is not 
necessarily required in Python.

In C++,  the sub-classing with virtual membership function 
reload mechanism is the equivalent part.


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to