#22774 closed defect (fixed)
Deprecation warning message should guide a user to import lcm from sage.arith.all.
Reported by:  klee  Owned by:  

Priority:  minor  Milestone:  sage8.0 
Component:  basic arithmetic  Keywords:  
Cc:  vdelecroix  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Kwankyu Lee, Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  9a762f0 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description
As of Sage 8.0.beta, the location of lcm has changed from sage.arith.misc
to sage.arith.functions
, and the deprecation warning warns that lcm should be imported directly from sage.arith.functions
. But the close friend gcd is still in sage.arith.misc
and an ordinary user would expect gcd and lcm found in the same package.
From the user point of view, everything should be imported as
from sage.arith.all import gcd, lcm
and the warning message should guide a user to import lcm from sage.arith.all
.
Change History (13)
comment:1 Changed 6 years ago by
Cc:  vdelecroix added 

comment:3 Changed 6 years ago by
Replying to vdelecroix:
I got the following deprecation warning
sage: from sage.rings.arith import gcd sage: gcd(2,3) ...:2881: DeprecationWarning: Importing gcd from here is deprecated. If you need to use it, please import it directly from sage.arith.all See http://trac.sagemath.org/19879 for details. exec(code_obj, self.user_global_ns, self.user_ns) 1 sage: from sage.rings.arith import lcm sage: lcm(2,3) ...:2881: DeprecationWarning: Importing lcm from here is deprecated. If you need to use it, please import it directly from sage.arith.all See http://trac.sagemath.org/19879 for details. exec(code_obj, self.user_global_ns, self.user_ns) 6And
sage.arith.functions
is not mentioned.
I guess that is a different deprecation message. Try from sage.arith.misc import lcm
. But you will still not see the warning message as this is already imported at startup. To see that, write a short script.
comment:4 Changed 6 years ago by
Branch:  → u/klee/22774 

Commit:  → ba7e9cab3074ce1153236807f766900492cff005 
New commits:
ba7e9ca  Change warning message

comment:5 Changed 6 years ago by
Status:  new → needs_review 

comment:6 Changed 6 years ago by
Branch:  u/klee/22774 → u/jdemeyer/22774 

comment:7 Changed 6 years ago by
Authors:  → Jeroen Demeyer 

Commit:  ba7e9cab3074ce1153236807f766900492cff005 → 9a762f03b80c3de388740a5b5266f6d9af4f3c9a 
I think this is a simpler solution.
New commits:
9a762f0  Deprecation warning message should guide a user to import lcm from sage.arith.all

comment:10 Changed 6 years ago by
Reviewers:  → Kwankyu Lee 

Status:  needs_review → positive_review 
comment:11 Changed 6 years ago by
Reviewers:  Kwankyu Lee → Kwankyu Lee; Vincent Delecroix 

comment:12 Changed 6 years ago by
Branch:  u/jdemeyer/22774 → 9a762f03b80c3de388740a5b5266f6d9af4f3c9a 

Resolution:  → fixed 
Status:  positive_review → closed 
comment:13 Changed 5 years ago by
Commit:  9a762f03b80c3de388740a5b5266f6d9af4f3c9a 

Reviewers:  Kwankyu Lee; Vincent Delecroix → Kwankyu Lee, Vincent Delecroix 
I got the following deprecation warning
And
sage.arith.functions
is not mentioned.