Re: Getting function and args from generator objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    Re: Getting function and args from generator objects

    Rui Jorge Rei wrote:
    I have been searching for a way to fetch the originating function object
    from a generator.
    Futile, I believe.

    I would also like to get all the arguments and keyword
    arguments that were used when calling the function that created the
    generator.
    The arguments to a generator function are the arguments to the generator
    's next method. The code is (in 3.0, at least) .gi_code and you can
    extract whatever you can from that.

    tjr



Working...