openedx / openedx/XBlock

Syntax warning due to comparison of literals using is in Python 3.8

Open
#453 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.