Why not allow empty code blocks?

Chris Angelico rosuav at gmail.com
Wed Aug 3 17:39:31 EDT 2016


On Thu, Aug 4, 2016 at 6:53 AM, BartC <bc at freeuk.com> wrote:
> On 03/08/2016 21:12, Chris Angelico wrote:
>>
>> Fairly common approach - and it means you'll never find those .py
>> files. So it's no different from looking for sys.py and not finding
>> it, except that in the case of CPython's sys, it's not even a DLL -
>> it's part of the interpreter core.
>
>
> I don't understand. With direct access to msvcrt.dll, the interface to that
> will be inside a .py file. Not buried away somewhere else.

Oh. CPython takes a much simpler approach: instead of forcing a Python
module to "think like C", it allows a C module to export functions to
Python. So when you "import math", you actually get something from a
.so/.dll file. I've no idea how Jython does this; it appears that
math.__file__ is AttributeError. Ditto PyPy.

ChrisA



More information about the Python-list mailing list