From d9ed43d5e02cd2f6d5b434e825654c4e644046a4 2024-01-24 20:02:25 From: Matthias Bussonnier Date: 2024-01-24 20:02:25 Subject: [PATCH] Deprecate more complicated way of defining colors. Keep simple with a dict. --- diff --git a/IPython/utils/coloransi.py b/IPython/utils/coloransi.py index 5a061f2..8404798 100644 --- a/IPython/utils/coloransi.py +++ b/IPython/utils/coloransi.py @@ -10,6 +10,7 @@ import os +import warnings from IPython.utils.ipstruct import Struct @@ -114,8 +115,18 @@ class ColorScheme: name: str colors: Struct - def __init__(self,__scheme_name_,colordict=None,**colormap): + def __init__(self, __scheme_name_, colordict=None, **colormap): self.name = __scheme_name_ + if colormap: + warnings.warn( + "Passing each colors as a kwarg to ColorScheme is " + "considered for deprecation. Please pass a " + "dict as single dict as second parameter. If you are using this" + "Feature, please comment an subscribe to issue " + "https://github.com/ipython/ipython/issues/14304", + PendingDeprecationWarning, + stacklevel=2, + ) if colordict is None: self.colors = Struct(**colormap) else: