From 22838e6c7905a5af33987b29b5798daaadb713fd 2018-04-04 08:12:04 From: Min RK Date: 2018-04-04 08:12:04 Subject: [PATCH] Merge pull request #11073 from Carreau/remove-io-meth Deprecate some methods from IPython.utils.io --- diff --git a/IPython/utils/io.py b/IPython/utils/io.py index 3a4582f..3b518f2 100644 --- a/IPython/utils/io.py +++ b/IPython/utils/io.py @@ -210,35 +210,34 @@ def temp_pyfile(src, ext='.py'): f.flush() return fname, f +@undoc def atomic_writing(*args, **kwargs): """DEPRECATED: moved to notebook.services.contents.fileio""" - warn("IPython.utils.io.atomic_writing has moved to notebook.services.contents.fileio", stacklevel=2) + warn("IPython.utils.io.atomic_writing has moved to notebook.services.contents.fileio since IPython 4.0", DeprecationWarning, stacklevel=2) from notebook.services.contents.fileio import atomic_writing return atomic_writing(*args, **kwargs) +@undoc def raw_print(*args, **kw): - """Raw print to sys.__stdout__, otherwise identical interface to print().""" + """DEPRECATED: Raw print to sys.__stdout__, otherwise identical interface to print().""" + warn("IPython.utils.io.raw_print has been deprecated since IPython 7.0", DeprecationWarning, stacklevel=2) print(*args, sep=kw.get('sep', ' '), end=kw.get('end', '\n'), file=sys.__stdout__) sys.__stdout__.flush() - +@undoc def raw_print_err(*args, **kw): - """Raw print to sys.__stderr__, otherwise identical interface to print().""" + """DEPRECATED: Raw print to sys.__stderr__, otherwise identical interface to print().""" + warn("IPython.utils.io.raw_print_err has been deprecated since IPython 7.0", DeprecationWarning, stacklevel=2) print(*args, sep=kw.get('sep', ' '), end=kw.get('end', '\n'), file=sys.__stderr__) sys.__stderr__.flush() - -# Short aliases for quick debugging, do NOT use these in production code. -rprint = raw_print -rprinte = raw_print_err - - +@undoc def unicode_std_stream(stream='stdout'): """DEPRECATED, moved to nbconvert.utils.io""" - warn("IPython.utils.io.unicode_std_stream has moved to nbconvert.utils.io", stacklevel=2) + warn("IPython.utils.io.unicode_std_stream has moved to nbconvert.utils.io since IPython 4.0", DeprecationWarning, stacklevel=2) from nbconvert.utils.io import unicode_std_stream return unicode_std_stream(stream) diff --git a/docs/source/whatsnew/pr/deprecations.rst b/docs/source/whatsnew/pr/deprecations.rst new file mode 100644 index 0000000..386ab11 --- /dev/null +++ b/docs/source/whatsnew/pr/deprecations.rst @@ -0,0 +1,7 @@ +A couple of unused function and methods have been deprecated and will be removed +in future versions: + + - ``IPython.utils.io.raw_print_err`` + - ``IPython.utils.io.raw_print`` + +