Yup, it looks as though the docs for the Python zipimport now include the .pyc feature. Great! More importantly to App Engine users, though, .pyc files in zips are not supported by App Engine's implementation of zipimport. dev_appserver will use Python's zipimport, so when preparing your zips, be careful to include all .py files so that your zips will work both in dev and on App Engine.
-- Dan On Mon, Dec 22, 2008 at 3:27 PM, Alexander Konovalenko <[email protected]>wrote: > The "Using Django 1.0 on App Engine with Zipimport" article by Dan > Sanderson [1] calls the support for .pyc files an "undocumented > feature" of the standard zipimport implementation. > > On the other hand, the module's documentation for Python 2.5.3 [2] > mentions .pyc files along with .py files everywhere and thus suggests > that they are equally supported by zipimport. Here are some relevant > quotations: > > "This module adds the ability to import Python modules (*.py, *.py > [co]) and packages from ZIP-format archives." > > "Any files may be present in the ZIP archive, but only files .py > and .py[co] are available for import. ZIP import of dynamic modules > (.pyd, .so) is disallowed. Note that if an archive only contains .py > files, Python will not attempt to modify the archive by adding the > corresponding .pyc or .pyo file, meaning that if a ZIP archive doesn't > contain .pyc files, importing may be rather slow." > > Looks like that feature was still undocumented when the article was > originally written. Should the article be corrected to call it a > feature that is currently missing from the App Engine implementation > of zipimport? > > Or do I misunderstand something? > > [1] http://code.google.com/appengine/articles/django10_zipimport.html > [2] http://www.python.org/doc/2.5.3/lib/module-zipimport.html > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
