Skip to content

Implements sage.misc.misc.inject_variable(name, value) #7776

@nthiery

Description

@nthiery

From the doc:

    inject a variable into the main global namespace

    INPUT:
     - name  - a string
     - value - anything

    EXAMPLES::

        sage: from sage.misc.misc import inject_variable
        sage: inject_variable("a", 314)
        sage: a
        314

This will be used in the upcoming "inject_shorthands" patch for symmetric functions #7777, and could be used in the various inject_variable code instead of manipulating directly globals() (which could be incorrect if not called directly from the interpreter/notebook.

CC: @sagetrac-sage-combinat

Component: user interface

Author: Nicolas M. Thiéry

Reviewer: Mike Hansen

Merged: sage-4.3.1.rc0

Issue created by migration from https://trac.sagemath.org/ticket/7776

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions