<div><div class="gmail_quote">On Tue, May 3, 2011 at 4:00 AM, <span dir="ltr"><<a href="mailto:edu-sig-request@python.org">edu-sig-request@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
[Edu-sig] What is a Python module?</blockquote></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">I posed this question before. The usual answer is: a file containing<br>Python source code.<br></span></blockquote>
<div><br></div>Kirby:<div> The "usual" answer is almost the correct answer.</div><div>I quote from <a href="http://docs.python.org/py3k/tutorial/modules.html">http://docs.python.org/py3k/tutorial/modules.html</a> which was written by GvR himself. A higher authority than BDFL cannot exist.</div>
<div><span class="Apple-style-span" style="font-family: sans-serif; font-size: 16px; line-height: 20px; ">"<span class="Apple-style-span" style="background-color: rgb(255, 255, 153);">A module is a file containing Python definitions and statements.</span></span> "<div>
I note that GvR does not mention that it must be in source form, only that it contain definitions and statements. The tutorial continues to give much more information about what modules are and how they work.</div><div>
<br>
</div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">In fact, one could argue a Python module is precisely *not* the<br>readable source code .py file, as that *must* be compiled to byte<br>
codes first, and saved in the .pyc.</span></blockquote><div><br></div><div>One could make such an argument, but one would be incorrect. IronPython, for example, _never_ compiles to .pyc byte code, but the modules I write using it are still Python modules, and still do what modules are supposed to do.</div>
<div>--</div><div>Vernon Cole</div><div><br></div></div></div>