Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scalene doesn't see code loaded via exec? #824

Open
tsvibt opened this issue May 10, 2024 · 0 comments
Open

scalene doesn't see code loaded via exec? #824

tsvibt opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tsvibt
Copy link

tsvibt commented May 10, 2024

(I don't know if this is intended behavior, so I don't know if it's a bug.)

It seems scalene doesn't see the code for functions loaded by exec. If I have a file like this:

def function():
   [x+x for x in range(100000)]
   [x*x for x in range(100000)]

function()
function()

and run scalene scalene_test1.py, I get:

Screenshot 2024-05-09 at 19 15 17

But if the file has this:

code = '''
def function():
   [x+x for x in range(100000)]
   [x*x for x in range(100000)]
'''
exec(code)

function()
function()

I get this:

Screenshot 2024-05-09 at 19 16 09

What's up with that? Is this intended behavior?

@emeryberger emeryberger added wontfix This will not be worked on and removed wontfix This will not be worked on labels May 12, 2024
@emeryberger emeryberger added the bug Something isn't working label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants