Syntax warning due to comparison of literals using is in Python 3.8
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 470
- Forks
- 231
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 6
Description
find . -iname '*.py' | grep -Ev 'setup|rdf4|tool' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./xblock/test/test_runtime.py:459: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 1 is self.mixologist.mix(FieldTester).number
./xblock/test/test_runtime.py:460: SyntaxWarning: "is" with a literal. Did you mean "=="?
assert 1 is self.mixologist.mix(FieldTester).fields['field'].default
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in xblock/test/test_runtime.py at lines 459-460, where Python 3.8 reports comparisons of literals using is. Run the Python 3.8 -Wall compilation command from the issue, then verify those warnings no longer appear and the test file still passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100