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

No inline values shown for results of function #241942

Closed
chrisdias opened this issue Feb 25, 2025 · 2 comments
Closed

No inline values shown for results of function #241942

chrisdias opened this issue Feb 25, 2025 · 2 comments
Assignees

Comments

@chrisdias
Copy link
Member

Testing #241791

I would expect to see inline values for at least line 15 given the other examples. But, I don't see any in this cell.

Image

here's the code:

def divide_numbers(a, b):
    try:
        result = a / b
        return result
    except ZeroDivisionError:
        return "Error: Division by zero!"
    except TypeError:
        return "Error: Invalid input types!"
    finally:
        print("Division operation attempted")

# Test error handling
print(divide_numbers(10, 2))
print(divide_numbers(10, 0))
print(divide_numbers(10, "2"))
@bamurtaugh
Copy link
Member

I was going to report what I believe is the same type of scenario, where I didn't get an inline value for outer_function():

# Variable reuse and scopes
def outer_function():
    outer_var = 'outer'
    def inner_function():
        inner_var = 'inner'
        print(f'Inner function can access: {outer_var} and {inner_var}')
    inner_function()
    print(f'Outer function can access: {outer_var}')
    c = 100
    result = 10
    return c

outer_function()

Image

But it looks like this matches how local_fn() was shown in the TPI:

Image

@Yoyokrazy
Copy link
Contributor

yep, this one is also by design, similar to the reason i closed another issue. we only store variable values in the kernel, so I can get the value of the fn if assigned to a variable, but otherwise that's only known during execution of a cell, not after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants