Proposal for .py2, py3, etc. extensions. Was: A way to accommodate laguage changes

James Logajan JamesL at Lugoj.Com
Tue Jul 24 18:14:09 EDT 2001


Bjorn Pettersen wrote:
> 
> > From: James Logajan [mailto:JamesL at Lugoj.Com]
[ On new module name extensions. ]
> I like the idea, however Python source is not always in a file (e.g. zip
> archives, ZODB databases, etc.)

True, but if it is zipped, it has to be unzipped for an interpreter to get
at it. When it does, if it is "old" code it will end in .py or .pyc (or
.pyo). Basically if the code is imported using the import statement, then
this should work. If one is pulling bytecode from a repository and using the
imp module, the pyc magic string (which all .pyc modules have) indicates to
the interpreter whether it is bytecode it can handle. If module source code
is stored in a database without an extension, then that is a possible
problem. I would say though that is application specific and that such
applications should assume it runs under the old semantics. I am not
familiar with Zope to know if this a serious issue, or if there are
workarounds.



More information about the Python-list mailing list