[Python-ideas] A new .pyc file format

gagsl-py2 at yahoo.com.ar gagsl-py2 at yahoo.com.ar
Tue Apr 29 11:44:38 CEST 2008


On Sat, 26 Apr 2008 13:21:59 -0300, Jim Jewett
<jimjjewett-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
escribió:
> On 4/25/08, Gabriel Genellina  
> <gagsl-py2-/E1597aS9LQMlKAeRRkD2Q at public.gmane.org>
wrote:
>
>>  The problem is that this [pyc] format is *too* 
>>  simple. It can't be changed, nor can accomodate 
>>  other fields if desired.
>
> Why do you need to?  Except for bootstrapping, 
> can't you make all these changes with a custom 
> loader/importer?
> 
> Shipping python with default support for a new 
> format may be reasonable as well -- the 
> interpreter already handles both pure python and 
> extension modules.  Even hooking it in as an 
> alternate generated format just extends the 
> pyo/pyc decision.

I want to unify pyc+pyo so they coexist on the same
file.

> Or were you suggesting that the stdlib should use 
> this new format by default, or even strictly 
> instead of the current format?  If so, what are 
> the advantages in the normal case?  (Deferring 
> the load of docstrings?  Better categorization by 
> some external tool?)

Yes, the idea is to *replace* completely the current
format, not to add another alternative.
There are now 4 different code variants: using -O or
not, and using -U or not; the first one changes the 
file extension, the second changes the magic number.
If the .pyc format could handle more than one 
variant, they all could be stored in a single file. 
Other kind of data can be stored too.

Deferring docstrings can't be done without changing 
the marshal format, and that's out of the scope of 
this proposal (until now).

-- 
Gabriel Genellina

Gabriel Genellina
Softlab SRL


      Yahoo! Encuentros.

Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! Encuentros http://yahoo.cupidovirtual.com/servlet/NewRegistration



More information about the Python-ideas mailing list