From de562f8caa6a02d6a482ee069e333e154f3e65cf 2024-10-25 08:34:44 From: M Bussonnier Date: 2024-10-25 08:34:44 Subject: [PATCH] Fix re pattern pretty print (#14559) Alternative to #14558 --- diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py index 48422c2..a232e4e 100644 --- a/IPython/lib/pretty.py +++ b/IPython/lib/pretty.py @@ -724,8 +724,15 @@ class _ReFlags: def _repr_pretty_(self, p, cycle): done_one = False - for flag in ('TEMPLATE', 'IGNORECASE', 'LOCALE', 'MULTILINE', 'DOTALL', - 'UNICODE', 'VERBOSE', 'DEBUG'): + for flag in ( + "IGNORECASE", + "LOCALE", + "MULTILINE", + "DOTALL", + "UNICODE", + "VERBOSE", + "DEBUG", + ): if self.value & getattr(re, flag): if done_one: p.text('|')