MRAB wrote:
> One thing that puzzles me is that the PEP shows that "Python -U" has a
> different magic number from "Python", but I can't find any reference to
> "-U" (the options appear to be case-sensitive, so presumably it's not
> the same as "-u").

We deliberate don't document -U because its typical effect is "break the
world" - it makes all strings unicode in 2.x.

You really don't want a -U pyc in a non -U interpreter and vice-versa,
hence the difference magic numbers.

This is also the reason why using the version number in the filename
isn't adequate - the magic number can change due to more than just the
Python version changing. Also, if we don't change the bytecode for a
given release, then multiple versions can use the same magic number.

Hiding these away in an appropriately named subfolder is the nicest way
to handle it without cluttering the source code directory.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to