# New SyntaxWarnings appear with Python 3.8

**URL:** https://discourse.paraview.org/t/new-syntaxwarnings-appear-with-python-3-8/4877
**Category:** In Situ Support
**Tags:** python
**Created:** [July 17, 2020, 4:54pm UTC](https://discourse.paraview.org/t/new-syntaxwarnings-appear-with-python-3-8/4877 "2020-07-17T16:54:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![olearypatrick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olearypatrick/32/9_2.png) [@olearypatrick](https://discourse.paraview.org/u/olearypatrick)
#### Post date: [July 17, 2020, 4:54pm UTC](https://discourse.paraview.org/t/new-syntaxwarnings-appear-with-python-3-8/4877/1 "2020-07-17T16:54:26Z")

</div>

New SyntaxWarning for ‘is’ with literals starting with Python 3.8

> [@](#):
>
> The compiler now produces a [`SyntaxWarning`](https://docs.python.org/3.8/library/exceptions.html#SyntaxWarning) when identity checks ( `is` and `is not` ) are used with certain types of literals (e.g. strings, numbers). These can often work by accident in CPython, but are not guaranteed by the language spec. The warning advises users to use equality tests ( `==` and `!=` ) instead. (Contributed by Serhiy Storchaka in [bpo-34850](https://bugs.python.org/issue34850).)

It currently works by accident in coprocessing by produces a number of these warnings:

```auto
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:859: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not root_directory.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:866: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.__RootDirectory is "":
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/tpl/cinema_python/adaptors/paraview/pv_introspect.py:198: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if proxy['parent'] is '0' and numberOfProducers > 0:
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:859: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not root_directory.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:866: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.__RootDirectory is "":
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:17: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if rd is not '' and not rd.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:24: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.__RootDirectory is not '':
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:32: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.__RootDirectory is not '':
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:76: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.__RootDirectory is not '' and not os.path.exists(self.__RootDirectory):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:179: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not root_directory.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:181: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not os.path.exists(root_directory):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:274: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not ssp.HasAnnotation("enabled") or not (ssp.GetAnnotation("enabled") is '1'):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/tpl/cinema_python/adaptors/paraview/pv_introspect.py:198: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if proxy['parent'] is '0' and numberOfProducers > 0:
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:859: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not root_directory.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:866: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.__RootDirectory is "":
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:17: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if rd is not '' and not rd.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:24: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.__RootDirectory is not '':
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:32: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.__RootDirectory is not '':
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:76: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if self.__RootDirectory is not '' and not os.path.exists(self.__RootDirectory):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:179: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not root_directory.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:181: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not os.path.exists(root_directory):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/detail/exportnow.py:274: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if not ssp.HasAnnotation("enabled") or not (ssp.GetAnnotation("enabled") is '1'):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/tpl/cinema_python/adaptors/paraview/pv_introspect.py:198: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if proxy['parent'] is '0' and numberOfProducers > 0:
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:859: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if root_directory is not '' and not root_directory.endswith("/"):
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/coprocessing.py:866: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.__RootDirectory is "":
/home/olearypatrick/code/ParaView/lib/python3.7/site-packages/paraview/tpl/cinema_python/adaptors/paraview/pv_introspect.py:198: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if proxy['parent'] is '0' and numberOfProducers > 0:
```

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [July 17, 2020, 5:44pm UTC](https://discourse.paraview.org/t/new-syntaxwarnings-appear-with-python-3-8/4877/2 "2020-07-17T17:44:36Z")

</div>

Patrick, would you mind creating an issue in the issue tracker for this?

---

<div class="post-metadata">

### Author: ![olearypatrick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olearypatrick/32/9_2.png) [@olearypatrick](https://discourse.paraview.org/u/olearypatrick)
#### Post date: [July 17, 2020, 5:55pm UTC](https://discourse.paraview.org/t/new-syntaxwarnings-appear-with-python-3-8/4877/3 "2020-07-17T17:55:49Z")

</div>

done [20086](http://gitlab.kitware.com/paraview/paraview/-/issues/20086)
