Source code for itertools
vicente.soler at gmail.com
Wed Sep 1 21:29:52 CEST 2010
On 31 ago, 05:33, Rolando Espinoza La Fuente <dark... at gmail.com>
> On Mon, Aug 30, 2010 at 11:06 PM, vsoler <vicente.so... 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__)
> 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.
> Rolando Espinoza La fuentewww.insophia.com
Thank you Rolando for your contribution.
Followinf your piece of advice I got:
>>> import itertools
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
AttributeError: 'module' object has no attribute '__file__'
So, I undestand that the module is written in C.
More information about the Python-list