Closed CaseyFaist closed 4 years ago
Related to https://github.com/thp/minidb/pull/11, feel free to check (after reading that PR) what's the best way and submit a PR.
This should be fixed in the just-released minidb 2.0.3, please let me know if you still have issues after upgrading the package:
python3 -m pip install --upgrade minidb
Hi! When working on urlwatch, I ran into the following warning while running the project with Python 3.8.2:
I also encountered this error when importing it via python repl, and when trying to run the tests.
I can confirm that downgrading the environment to 3.7 resolves the warning - and found a description of this change in Python 3.8 here: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/
This is a warning, and not a breaking issue - and it's possible to silence the warning: https://docs.python.org/2/library/warnings.html#temporarily-suppressing-warnings
But also, the change required to correct the issue looks minimal, and the warning has been introduced to highlight potentially unexpected behavior in the previous convention.
The biggest issue with this warning is that downstream developers, using a project that uses minidb (such as urlwatch). The warning adds confusion for them (took me a second to confirm my environment was properly configured), and they may mistake it as an error traceback and think something's wrong.
Suggested fix is to convert the
is
statements here to==
as recommended by the warning, as this is also backwards compatible with Python 3.7, 3.6 and 2.7: https://github.com/thp/minidb/blob/master/minidb.py#L144Happy to submit the PR if my suggested fix is acceptable 🎉