The 'is' operator is not meant to be used for comparisons. It currently working is an implementation detail of CPython. CPython 3.8 has added a SyntaxWarning for this.