SheffieldML / GPy

Gaussian processes framework in python
BSD 3-Clause "New" or "Revised" License
1.99k stars 559 forks source link

python3.10 gpy SyntaxWarning (literal with is) #1023

Open DaanVanVugt opened 11 months ago

DaanVanVugt commented 11 months ago

Hi, I'm encountering the following warning (turned error by our CI) with python3.9 and python3.10 (did not check others)

run_bq.py:10: in import GPy /app/.venv/lib/python3.10/site-packages/GPy/init.py:6: in from . import core /app/.venv/lib/python3.10/site-packages/GPy/core/init.py:49: in from .gp import GP /app/.venv/lib/python3.10/site-packages/GPy/core/gp.py:9: in from .. import kern /app/.venv/lib/python3.10/site-packages/GPy/kern/init.py:63: in from .src.symmetric import Symmetric E File "/app/.venv/lib/python3.10/site-packages/GPy/kern/src/symmetric.py", line 56 E if symmetry_type is 'odd': E ^^^^^^^^^^^^^^^^^^^^^^ E SyntaxError: "is" with a literal. Did you mean "=="?

Note that to reproduce I need to remove the .pyc file generated

MartinBubel commented 9 months ago

Thanks for pointing this out!

We will consider this as a quality of life improvement in an upcoming release.

Would you be interested in doing a PR?

DaanVanVugt commented 7 months ago

Hi Martin, Thanks for considering. I don't have time to make a PR for this unfortunately, sorry.