Re: how python dir works

2012-04-18 Thread Steven D'Aprano
On Wed, 18 Apr 2012 08:56:24 -0700, cheung wrote: > how does the function "dir" works, where can I get the python-c source > of dir in py2.7 project. Look for the function builtin_dir in Python/bltinmodule.c of the source code. > I looked the python_c source for hours, can't find how dir wor

Re: how python dir works

2012-04-18 Thread Terry Reedy
On 4/18/2012 11:56 AM, cheung wrote: how does the function "dir" works, > where can I get the python-c source of dir in py2.7 project. Interesting question. The CPython source is here: hg.python.org/cpython/ From there, select branches, 2.7, and browse. From there, Python/bltinmodule.c has so

Re: how python dir works

2012-04-18 Thread Vincent Vande Vyvre
Le 18/04/12 18:15, Ian Kelly a écrit : > On Wed, Apr 18, 2012 at 9:56 AM, cheung wrote: >> how does the function "dir" works, where can I get the python-c source of >> dir in py2.7 project. >> >> I looked the python_c source for hours, can't find how dir works. > http://hg.python.org/cpython/fi

Re: how python dir works

2012-04-18 Thread Ian Kelly
On Wed, Apr 18, 2012 at 9:56 AM, cheung wrote: > how does the function  "dir" works, where can I get the python-c  source of > dir in py2.7 project. > > I looked the python_c source for hours, can't find how dir works. http://hg.python.org/cpython/file/67be12ab8948/Objects/object.c#l1957 > for

how python dir works

2012-04-18 Thread cheung
how does the function "dir" works, where can I get the python-c source of dir in py2.7 project. I looked the python_c source for hours, can't find how dir works. for example: if a user input a *.py source file like foo.py, i wanna parse the file, and find all the functions and all the cla