where to view open() function's C implementation source code ?

Discussion in 'Python' started by iMath, Dec 18, 2012.

  1. iMath

    iMath Guest

    where to view open() function's C implementation source code ?
    iMath, Dec 18, 2012
    #1
    1. Advertising

  2. iMath

    Roy Smith Guest

    Re: where to view open() function's C implementation source code ï¼

    In article <>,
    iMath <> wrote:

    > where to view open() function's C implementation source code ?


    http://www.python.org/download/releases/

    Download the source for the version you're interested in.
    Roy Smith, Dec 18, 2012
    #2
    1. Advertising

  3. iMath

    iMath Guest

    Re: where to view open() function's C implementation source code �

    在 2012å¹´12月18日星期二UTC+8下åˆ1æ—¶35分58秒,Roy Smith写é“:
    > In article <>,
    >
    > iMath <> wrote:
    >
    >
    >
    > > where to view open() function's C implementation source code ?

    >
    >
    >
    > http://www.python.org/download/releases/
    >
    >
    >
    > Download the source for the version you're interested in.


    but which python module is open() in ?
    iMath, Dec 18, 2012
    #3
  4. iMath

    Terry Reedy Guest

    On 12/18/2012 12:25 AM, iMath wrote:
    > where to view open() function's C implementation source code ?


    depends on the python version. io in 3.x
    otherwise, it is a builtin

    --
    Terry Jan Reedy
    Terry Reedy, Dec 18, 2012
    #4
  5. iMath

    Roy Smith Guest

    Re: where to view open() function's C implementation source code ?

    In article <>,
    iMath <> wrote:

    > Â� 2012”N12ŒŽ18“�Â�Š�“�UTC+8‰�Œ�1æ—¶35分58秒,Roy Smith写é“:
    > > In article <>,
    > >
    > > iMath <> wrote:
    > >
    > >
    > >
    > > > where to view open() function's C implementation source code ?

    > >
    > >
    > >
    > > http://www.python.org/download/releases/
    > >
    > >
    > >
    > > Download the source for the version you're interested in.

    >
    > but which python module is open() in ?


    I met you half-way, I showed you where the source code is. Now you
    need to come the other half and look at the code. Maybe start by
    grepping the entire source tree for "open"?
    Roy Smith, Dec 18, 2012
    #5
  6. Re: where to view open() function's C implementation source code ?

    On Wed, Dec 19, 2012 at 1:28 AM, Roy Smith <> wrote:
    > In article <>,
    > iMath <> wrote:
    >> > Download the source for the version you're interested in.

    >>
    >> but which python module is open() in ?

    >
    > I met you half-way, I showed you where the source code is. Now you
    > need to come the other half and look at the code. Maybe start by
    > grepping the entire source tree for "open"?


    Ouch, that mightn't be very effective! With some function names, you
    could do that. Not so much "open". Still, it'd be a start...

    ChrisA
    Chris Angelico, Dec 18, 2012
    #6
  7. iMath

    Guest

    Re: where to view open() function's C implementation source code �

    On Monday, December 17, 2012 10:35:58 PM UTC-7, Roy Smith wrote:
    > iMath <> wrote:
    > > where to view open() function's C implementation source code ?

    > http://www.python.org/download/releases/
    > Download the source for the version you're interested in.


    iMath:

    There is no need to download the source. You can browse the
    source code online. For the v3.0.0 version of open():
    hg.python.org/cpython/file/bd8afb90ebf2/Modules/_io/_iomodule.c

    For 2.7.3 I think what you want is the builtin_open() function in
    http://hg.python.org/cpython/file/70274d53c1dd/Python/bltinmodule.c
    and the file object and open_the_file() function in
    http://hg.python.org/cpython/file/70274d53c1dd/Objects/fileobject.c

    Hope this helps.
    , Dec 18, 2012
    #7
  8. Re: where to view open() function's C implementation source code?

    On 12/18/2012 07:03 AM, Chris Angelico wrote:
    > On Wed, Dec 19, 2012 at 1:28 AM, Roy Smith<> wrote:
    >> In article<>,
    >> iMath<> wrote:
    >>>> Download the source for the version you're interested in.
    >>> but which python module is open() in ?

    >> I met you half-way, I showed you where the source code is. Now you
    >> need to come the other half and look at the code. Maybe start by
    >> grepping the entire source tree for "open"?

    > Ouch, that mightn't be very effective! With some function names, you
    > could do that. Not so much "open". Still, it'd be a start...
    >
    > ChrisA

    In Python3.3.0 -- the built in open() appears in
    Python-3.3.0/Modules/_io/_iomodule.c;
    There is another module defined in an object in
    Python-3.3.0/Modules/_io/fileio.c; but I don't think that the one called
    when a lone x=open(...) is done.

    Cheers.
    --Andrew.
    Andrew Robinson, Dec 18, 2012
    #8
  9. iMath

    Guest

    Re: where to view open() function's C implementation source code �

    On Tuesday, December 18, 2012 1:57:37 PM UTC-7, wrote:
    >[...]
    > source code online. For the v3.0.0 version of open():
    > hg.python.org/cpython/file/bd8afb90ebf2/Modules/_io/_iomodule.c


    oops, that should have been:
    http://hg.python.org/cpython/file/bd8afb90ebf2/Modules/_io/_iomodule.c
    , Dec 18, 2012
    #9
  10. iMath

    iMath Guest

    Re: where to view open() function's C implementation source code �

    在 2012å¹´12月19日星期三UTC+8上åˆ4æ—¶57分37秒,写é“:
    > On Monday, December 17, 2012 10:35:58 PM UTC-7, Roy Smith wrote:
    >
    > > iMath <> wrote:

    >
    > > > where to view open() function's C implementation source code ?

    >
    > > http://www.python.org/download/releases/

    >
    > > Download the source for the version you're interested in.

    >
    >
    >
    > iMath:
    >
    >
    >
    > There is no need to download the source. You can browse the
    >
    > source code online. For the v3.0.0 version of open():
    >
    > hg.python.org/cpython/file/bd8afb90ebf2/Modules/_io/_iomodule.c
    >
    >
    >
    > For 2.7.3 I think what you want is the builtin_open() function in
    >
    > http://hg.python.org/cpython/file/70274d53c1dd/Python/bltinmodule.c
    >
    > and the file object and open_the_file() function in
    >
    > http://hg.python.org/cpython/file/70274d53c1dd/Objects/fileobject.c
    >
    >
    >
    > Hope this helps.


    thanks very much !
    iMath, Dec 18, 2012
    #10
  11. iMath

    iMath Guest

    Re: where to view open() function's C implementation source code �

    在 2012å¹´12月19日星期三UTC+8上åˆ4æ—¶57分37秒,写é“:
    > On Monday, December 17, 2012 10:35:58 PM UTC-7, Roy Smith wrote:
    >
    > > iMath <> wrote:

    >
    > > > where to view open() function's C implementation source code ?

    >
    > > http://www.python.org/download/releases/

    >
    > > Download the source for the version you're interested in.

    >
    >
    >
    > iMath:
    >
    >
    >
    > There is no need to download the source. You can browse the
    >
    > source code online. For the v3.0.0 version of open():
    >
    > hg.python.org/cpython/file/bd8afb90ebf2/Modules/_io/_iomodule.c
    >
    >
    >
    > For 2.7.3 I think what you want is the builtin_open() function in
    >
    > http://hg.python.org/cpython/file/70274d53c1dd/Python/bltinmodule.c
    >
    > and the file object and open_the_file() function in
    >
    > http://hg.python.org/cpython/file/70274d53c1dd/Objects/fileobject.c
    >
    >
    >
    > Hope this helps.


    thanks very much !
    iMath, Dec 18, 2012
    #11
  12. iMath

    Guest

    Re: where to view open() function's C implementation source code �

    On 12/18/2012 04:55 PM, iMath wrote:
    > > 在 2012å¹´12月19日星期三UTC+8上åˆ4æ—¶57分37秒,写é“:
    > >[...]
    >> >> There is no need to download the source. You can browse the
    >> >> source code online. For the v3.0.0 version of open():
    >> >> hg.python.org/cpython/file/bd8afb90ebf2/Modules/_io/_iomodule.c
    >> >>
    >> >> For 2.7.3 I think what you want is the builtin_open() function in
    >> >> http://hg.python.org/cpython/file/70274d53c1dd/Python/bltinmodule.c
    >> >> and the file object and open_the_file() function in
    >> >> http://hg.python.org/cpython/file/70274d53c1dd/Objects/fileobject.c
    >> >>
    >> >> Hope this helps.

    > >
    > > thanks very much !


    Your welcome.

    I noticed that you, like me, are using Google Groups. You
    might want to read this page about posting from Google Groups:

    http://wiki.python.org/moin/GoogleGroupsPython

    It will help you avoid double posts and other Google Groups
    posting problems that annoy other people here.
    , Dec 19, 2012
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jenny
    Replies:
    3
    Views:
    257
    Dag Sunde
    Dec 17, 2004
  2. iMath
    Replies:
    7
    Views:
    221
    Steven D'Aprano
    Jan 7, 2013
  3. iMath
    Replies:
    3
    Views:
    210
    iMath
    Oct 18, 2012
  4. iMath
    Replies:
    8
    Views:
    196
    Steven D'Aprano
    Oct 9, 2012
  5. iMath
    Replies:
    2
    Views:
    150
    Peter Otten
    Dec 26, 2012
Loading...

Share This Page