Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77914 > unrolled thread

Re: What's the function location that reads the cached .pyc file from disk.

Started bydieter <dieter@handshake.de>
First post2014-09-16 08:04 +0200
Last post2014-09-16 08:04 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: What's the function location that reads the cached .pyc file from disk. dieter <dieter@handshake.de> - 2014-09-16 08:04 +0200

#77914 — Re: What's the function location that reads the cached .pyc file from disk.

Fromdieter <dieter@handshake.de>
Date2014-09-16 08:04 +0200
SubjectRe: What's the function location that reads the cached .pyc file from disk.
Message-ID<mailman.14042.1410847506.18130.python-list@python.org>
Shiyao Ma <i@introo.me> writes:

> what's the location of the function that reads the .pyc file ?
>
> I bet it should lie in somewhere in
> https://hg.python.org/cpython/file/322ee2f2e922/Lib/importlib
>
> But what's the actual location?

Maybe, you look at the "importlib" source?

Note: the function you search is likely implemented in C.
Finally, you will likely need to look at the C code.


> Btw, why I need it?
> I want to know the structure of a .pyc file. Of course the function
> that reads the .pyc must know something about it.
> (I am aware of the structure of a typical .pyc file from some clicks
> of google pages, but I am interested in the *source* and the most
> authoritative answer, aka, the source code).

In documentation relative to the "marshal" module (internally used
for ".pyc" files), I have read that the details may vary between
Python versions. As "mashal" is used for ".pyc" files, the same likely
applies to ".pyc" files as well. Thus, do not depend too closely
on the things you may find by code inspection.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web