inspect.getsource bug?

Discussion in 'Python' started by Ciccio, Dec 26, 2010.

  1. Ciccio

    Ciccio Guest

    Try this:
    1) define a function 'foo' in a script
    2) runfile the script from a shell
    3) do 'inspect.getsource(foo)'
    4) change the source of 'foo'
    5) runfile the script from the same shell
    6) do 3 again

    On my 2.6.6 getsource returns twice the same code. I couldn't find
    very much about this, is there any known workaround?

    thanks
     
    Ciccio, Dec 26, 2010
    #1
    1. Advertising

  2. Ciccio

    Ciccio Guest

    On 26 Dic, 19:24, Ciccio <> wrote:
    > Try this:
    > 1) define a function 'foo' in a script
    > 2) runfile the script from a shell
    > 3) do 'inspect.getsource(foo)'
    > 4) change the source of 'foo'
    > 5) runfile the script from the same shell
    > 6) do 3 again
    >
    > On my 2.6.6 getsource returns twice the same code. I couldn't find
    > very much about this, is there any known workaround?
    >
    > thanks


    found this in the meantime: http://bugs.python.org/issue993580
     
    Ciccio, Dec 26, 2010
    #2
    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. Robin Becker

    bug in inspect (was cgitb vs traceback)

    Robin Becker, Jun 6, 2004, in forum: Python
    Replies:
    1
    Views:
    297
    Robin Becker
    Jun 6, 2004
  2. Chris S.

    Bug in Getsource?

    Chris S., Jun 22, 2004, in forum: Python
    Replies:
    2
    Views:
    396
    Chris S.
    Jun 26, 2004
  3. Ron Adam

    inspect getsource() minor fix?

    Ron Adam, Sep 19, 2005, in forum: Python
    Replies:
    0
    Views:
    288
    Ron Adam
    Sep 19, 2005
  4. Peng Yu
    Replies:
    0
    Views:
    287
    Peng Yu
    Jun 22, 2010
  5. deluxstar
    Replies:
    5
    Views:
    868
    Terry Reedy
    Sep 25, 2010
Loading...

Share This Page