Find This Module

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gregpinero@gmail.com

    #1

    Find This Module

    I'm looking at the source for the module sre_compile.py and it does
    this import:

    import _sre

    But I can't find a file related to _sre anywhere. Where is it? And
    more generally, how does one find the location of a built in module?

    Thanks,

    Greg

  • Marc 'BlackJack' Rintsch

    #2
    Re: Find This Module

    On Wed, 04 Jul 2007 20:00:07 +0000, gregpinero@gmai l.com wrote:
    I'm looking at the source for the module sre_compile.py and it does
    this import:
    >
    import _sre
    >
    But I can't find a file related to _sre anywhere. Where is it? And
    more generally, how does one find the location of a built in module?
    It's built into the interpreter executable.

    In [85]: import _sre

    In [86]: _sre
    Out[86]: <module '_sre' (built-in)>

    Ciao,
    Marc 'BlackJack' Rintsch

    Comment

    • Peter Otten

      #3
      Re: Find This Module

      gregpinero@gmai l.com wrote:
      I'm looking at the source for the module sre_compile.py and it does
      this import:
      >
      import _sre
      >
      But I can't find a file related to _sre anywhere. Where is it?
      If you want the source code, have a look at


      And more generally, how does one find the location of a built in module?
      For the source of modules written in C, built in or not, you have to look in
      the source distribution.

      Peter


      Comment

      Working...