473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Where's the source code for __builtin__?

I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions. I searched through the Modules, Objects, Python, and Parser
folder, searched docs.python.org, searched the archived messages of
this group, searched the web, and got absolutely nowhere in finding a
__builtin__.c, or anything that contains the builtin source code.

Help?

Apr 24 '07 #1
6 4594
On 25/04/2007 9:32 AM, Dustan wrote:
I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions. I searched through the Modules, Objects, Python, and Parser
folder, searched docs.python.org, searched the archived messages of
this group, searched the web, and got absolutely nowhere in finding a
__builtin__.c, or anything that contains the builtin source code.

Help?
What's the 2nd file (in alphabetical order) in the Python folder?

Apr 25 '07 #2
John Machin <sj******@lexicon.netwrites:
On 25/04/2007 9:32 AM, Dustan wrote:
I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions.

What's the 2nd file (in alphabetical order) in the Python folder?
What is "the Python folder"?

Assuming you mean "the folder for the Python standard library
modules":

$ ls -1 /usr/lib/python2.4/ | head -n 10
aifc.py
aifc.pyc
anydbm.py
anydbm.pyc
asynchat.py
asynchat.pyc
asyncore.py
asyncore.pyc
atexit.py
atexit.pyc

There are no files in that folder with 'builtin' in their name. I'm
don't know what point you're driving at.

--
\ "Oh, I love your magazine. My favorite section is 'How To |
`\ Increase Your Word Power'. That thing is really, really, |
_o__) really... good." -- Homer, _The Simpsons_ |
Ben Finney
Apr 25 '07 #3
Ben Finney wrote:
John Machin <sj******@lexicon.netwrites:
>On 25/04/2007 9:32 AM, Dustan wrote:
>>I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions.
What's the 2nd file (in alphabetical order) in the Python folder?

What is "the Python folder"?

Assuming you mean "the folder for the Python standard library
modules":
Actually, he meant the folder named 'Python' in the checkout from the
repository:

C:\...\python\2.X>dir Python

Directory of C:\...\python\2.X\Python

03/21/2007 12:13 PM <DIR .
03/21/2007 12:13 PM <DIR ..
02/17/2007 03:11 PM 697 asdl.c
03/19/2007 04:31 PM 103,444 ast.c
02/17/2007 03:11 PM 865 atof.c
03/19/2007 04:31 PM 66,286 bltinmodule.c

Probably 'bltinmodule.c' is a good place to start.

STeVe
Apr 25 '07 #4
On 25/04/2007 12:31 PM, Ben Finney wrote:
John Machin <sj******@lexicon.netwrites:
>On 25/04/2007 9:32 AM, Dustan wrote:
>>I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions.
You snipped the 2nd sentence of what the OP wrote:

""" I searched through the Modules, Objects, Python, and Parser
folder, searched docs.python.org, searched the archived messages of
this group, searched the web, and got absolutely nowhere in finding a
__builtin__.c, or anything that contains the builtin source code. """
He's looking through the *SOURCE* distribution.

>What's the 2nd file (in alphabetical order) in the Python folder?

What is "the Python folder"?

Assuming you mean "the folder for the Python standard library
modules":
Wrong assumption. You're expecting the source for builtin functions to
be written in Python?
>
$ ls -1 /usr/lib/python2.4/ | head -n 10
aifc.py
[snip]
atexit.pyc

There are no files in that folder with 'builtin' in their name.
And when you get to <source_distribution>/Python, you'll find that
that's still the case :-)
I'm
don't know what point you're driving at.
Astonishment that the OP missed it in his serial scan of file names,
even though the name wouldn't be picked up by glob.glob('*builtin*')

BTW there's this ancient gadget called 'grep' that can be used to find
patterns in files, like 'nameofabuiltinfunction('; any semi-usable
editor or IDE would have similar functionality.

Cheers,
John
Apr 25 '07 #5
On 25/04/2007 1:17 PM, Steven Bethard wrote:
Ben Finney wrote:
>John Machin <sj******@lexicon.netwrites:
>>On 25/04/2007 9:32 AM, Dustan wrote:
I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions.
What's the 2nd file (in alphabetical order) in the Python folder?

What is "the Python folder"?

Assuming you mean "the folder for the Python standard library
modules":

Actually, he meant the folder named 'Python' in the checkout from the
repository:

C:\...\python\2.X>dir Python

Directory of C:\...\python\2.X\Python

03/21/2007 12:13 PM <DIR .
03/21/2007 12:13 PM <DIR ..
02/17/2007 03:11 PM 697 asdl.c
03/19/2007 04:31 PM 103,444 ast.c
02/17/2007 03:11 PM 865 atof.c
03/19/2007 04:31 PM 66,286 bltinmodule.c

Probably 'bltinmodule.c' is a good place to start.
It *was* the 2nd file in the 2.4.3 source I happened to have lying
around on my hard drive :-)
Apr 25 '07 #6
On Apr 24, 7:52 pm, John Machin <sjmac...@lexicon.netwrote:
On 25/04/2007 9:32 AM, Dustan wrote:
I've been paging through the source code for various C modules in
python, and wanted to find the source of some of the builtin
functions. I searched through the Modules, Objects, Python, and Parser
folder, searched docs.python.org, searched the archived messages of
this group, searched the web, and got absolutely nowhere in finding a
__builtin__.c, or anything that contains the builtin source code.
Help?

What's the 2nd file (in alphabetical order) in the Python folder?
ast.c? But that doesn't help much...

But wait! There's another file... # 4 in the Python folder, which,
naturally following the explicit nature of python, is given the name
"bltinmodule.c".

I don't know how I managed to get more 'a' files than you did,
though... Anyway, thanks for pointing me to the right folder.

Apr 26 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Irmen de Jong | last post by:
Hello, I don't understand why the following doesn't work. What I want to do is dynamically import some generated Python code and I'm doing this using compile and exec'ing it in the dict of a new...
26
by: Steven Bethard | last post by:
I thought it might be useful to put the recent lambda threads into perspective a bit. I was wondering what lambda gets used for in "real" code, so I grepped my Python Lib directory. Here are some...
17
by: Grant Edwards | last post by:
I'm trying to figure out how to sort a list, and I've run into a problem that that I have tripped over constantly for years: where are the methods of basic types documented? The only thing I can...
10
by: malv | last post by:
I am involved in a major scientific algorithm design problem in which simulation of the underlying physics and visualization play an important role. Algorithm adaptation from run to run often...
15
by: amit.man | last post by:
Hi, i have newbie qestion, when i write #include <somthing.h> the precompiler subtitue that line with the lines from "somthing.h" header file. when, where and how the compiler insert the...
2
by: ArdPy | last post by:
Most of the other modules have an accompanying python source file. But that is not the case with __builtin__. What might be the reason? Isn't __builtin__ written in python?
3
by: GHUM | last post by:
I stumbled apon a paragraph in python-dev about "reducing the size of Python" for an embedded device: """ In my experience, the biggest gain can be obtained by dropping the rarely-used CJK...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
9
by: Joseph Turian | last post by:
I was given code that was written for python 2.5, and uses simple functions like 'all' which are not present in 2.4 I want to make the code 2.4 compatible. What is the best way to do this? If I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.