.. _redundant-u-string-prefix:

redundant-u-string-prefix / W1406
=================================

**Message emitted:**

The u prefix for strings is no longer necessary in Python >=3.0

**Description:**

*Used when we detect a string with a u prefix. These prefixes were necessary in Python 2 to indicate a string was Unicode, but since Python 3.0 strings are Unicode by default.*

**Problematic code:**

.. literalinclude:: /data/messages/r/redundant-u-string-prefix/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/r/redundant-u-string-prefix/good.py
   :language: python



Created by the `string <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/strings.py>`__ checker.