Skip to content

%time magic funtion prevents variable assigment when used in function #13137

@jurgispods

Description

@jurgispods

I'm using IPython version 7.27. The following code snippet throws a NameError: name 'variable' is not defined:

def test(msg):
    %time variable = msg
    print(variable)
    
test("moin")

The bug is similar to #11659 and #11813, but it seems to only occur when used inside a function body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions