[Python-ideas] Displaying DeprecationWarnings in the interactive interpreter, second try
M.-A. Lemburg
mal at egenix.com
Thu May 28 10:26:04 CEST 2015
On 28.05.2015 02:29, Nathaniel Smith wrote:
> Hi all,
>
> I'm tired of getting bug reports like this one:
>
> https://github.com/numpy/numpy/issues/5919
Well, in that particular case, I think numpy should raise a TypeError
instead of a DeprecationWarning :-)
> where the issue is just that the user didn't see deprecation warnings,
> so I just filed a bug report requesting that the interactive Python
> REPL start printing DeprecationWarnings when users use deprecated
> functionality:
>
> https://bugs.python.org/issue24294
+1 on the general idea, but I think this needs some more thought
on the topic of how you detect an interactive session that's being
used by a user.
You wouldn't want these warning to show up when piping in commands
to a Python interpreter.
In eGenix PyRun we use sys.stdin.isatty() to check whether we
want an interactive prompt or not. I guess the same could be done
here.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, May 28 2015)
>>> Python Projects, Coaching and Consulting ... http://www.egenix.com/
>>> mxODBC Plone/Zope Database Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the Python-ideas
mailing list