sagemath/sage

Enable setting attributes on a lazy imported object

Opened this issue · 1 comments

Scenario:

   from sage.all import Tableau # just one of the lazy imported objects in Sage
   Tableau.foo = 3

    sage: Tableau.foo = 1
    ...
    AttributeError: 'sage.misc.lazy_import.LazyImport' object has no attribute 'foo'

Do you foresee any problem with just implementing __setattr__ similarly to the current __getattr__?

CC: @jdemeyer @embray

Component: misc

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

comment:1

It don't see any obvious problems. Don't forget __delattr__ while you're at it.