[Tutor] Stacks and Stack underflow/Stack overflow

Alan Gauld alan.gauld at btinternet.com
Sun Nov 20 02:29:50 CET 2011


On 20/11/11 00:09, Steven D'Aprano wrote:
> Walter Prins wrote:
>
>> pickle files are binary files and you probably opened it as a text file.
>> See here: http://docs.python.org/py3k/library/functions.html#open
>
> Not so. Pickle protocol 0 is text, and it happens to be the default
> protocol used if you don't instruct it different. So by default, pickles
> are text unless you specifically use a binary protocol.

Now that's interesting. All the examples I've sen use binary files.
And even the examples on the documentation pages use binary mode.
I just assumed therefore that pickles would, by their nature, be binary...

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list