Source code for itertools

Rolando Espinoza La Fuente darkrho at gmail.com
Tue Aug 31 05:33:24 CEST 2010


On Mon, Aug 30, 2010 at 11:06 PM, vsoler <vicente.soler at gmail.com> wrote:
> On 31 ago, 04:42, Paul Rubin <no.em... at nospam.invalid> wrote:
>> vsoler <vicente.so... at gmail.com> writes:
>> > I was expecting an itertools.py file, but I don't see it in your list.
>> >> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c
>>
>> looks promising.  Lots of stdlib modules are written in C for speed or
>> access to system facilities.
>
> Lawrence, Paul,
>
> You seem to be running a utility I am not familiar with. Perhaps this
> is because I am using Windows, and most likely you are not.
>
> How could I have found the answer in a windows environment?

Hard question. They are using standard unix utilities.

But you can find the source file of a python module within python:

>>> import itertools
>>> print(itertools.__file__)
/usr/lib/python2.6/lib-dynload/itertools.so

Yours should point to a windows path. If the file ends with a ".py",
you can open the file
with any editor. If ends with ".so" or something else  likely is a
compiled module in C
and you should search in the source distribution, not the binary distribution.

Hope it helps.

Regards,


Rolando Espinoza La fuente
www.insophia.com



More information about the Python-list mailing list