Re: [sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-22 Thread Nils Bruin
On Sunday, October 20, 2019 at 2:00:49 PM UTC-7, Nils Bruin wrote: > > [I think that behaviour is a bug in Python's warning machinery. It's a > silent failure to issue a warning in a case where some warning is almost > certainly desired]. > Correcting myself on this one. Nothing is wrong in

Re: [sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-20 Thread Nils Bruin
On Saturday, October 19, 2019 at 1:20:15 PM UTC-7, David Roe wrote: > > I think the idea is that if a user's typing interactively then they don't > need a deprecation warning (since the behavior currently works). It's more > important to show a user a warning if they have the deprecated

Re: [sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-20 Thread Vincent Delecroix
Le 20/10/2019 à 11:17, Vincent Delecroix a écrit : Le 19/10/2019 à 13:19, David Roe a écrit : I think the idea is that if a user's typing interactively then they don't need a deprecation warning (since the behavior currently works).  It's more important to show a user a warning if they have

Re: [sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-20 Thread Vincent Delecroix
Le 19/10/2019 à 13:19, David Roe a écrit : I think the idea is that if a user's typing interactively then they don't need a deprecation warning (since the behavior currently works). It's more important to show a user a warning if they have the deprecated behavior in a function they've written.

Re: [sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-19 Thread John H Palmieri
Okay, that makes sense. I thought I had seen deprecation warnings from basic commands issued at the "sage:" prompt, but I must be misremembering. John On Saturday, October 19, 2019 at 1:20:15 PM UTC-7, David Roe wrote: > > The reason that the warning isn't printed is that the stacklevel is

Re: [sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-19 Thread David Roe
The reason that the warning isn't printed is that the stacklevel is set to 4 by default in order to tell the user where the Integer('012') is occurring. When you type '012' directly into the command line, the stack isn't deep enough and no warning is printed. You do see a warning if you write a

[sage-devel] Question about deprecation warnings: when do they appear in doctests vs. real life?

2019-10-19 Thread John H Palmieri
Here is a doctest from sage/rings/integer.pyx: sage: Integer('012') doctest:...: DeprecationWarning: use 0o as octal prefix instead of 0 If you do not want this number to be interpreted as octal, remove the leading zeros. See http://trac.sagemath.org/17413 for