Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tirkarthi opened this issue Dec 5, 2020 · 0 comments
Closed
Assignees

Comments

@tirkarthi
Copy link
Contributor

find . -iname '*.py' | xargs -P4 -I{} python3.8 -Walways::SyntaxWarning:: -m py_compile {}  
./psychopy/demos/coder/stimuli/MovieStim2TimingTest.py:316: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if procinfo['exe'] is not u"Access Denied" and (SAVE_PER_PROCESS_DATA is True or SAVE_PER_PROCESS_DATA == procinfo['name']):
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:133: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if (desired_model is 'HyperbolicMagnitudeEffect') or (desired_model is 'ExponentialMagnitudeEffect'):
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:133: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if (desired_model is 'HyperbolicMagnitudeEffect') or (desired_model is 'ExponentialMagnitudeEffect'):
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:196: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if desired_model is 'Hyperbolic':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:199: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'Exponential':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:202: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'MyersonHyperboloid':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:205: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'ModifiedRachlin':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:208: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'HyperbolicMagnitudeEffect':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:211: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'ExponentialMagnitudeEffect':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:215: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'HyperbolicNonLinearUtility':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:219: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'MultiplicativeHyperbolic':
./psychopy/demos/builder/adaptive_decision_making_demo/chooser.py:223: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif desired_model is 'LinearInLogOdds':
./psychopy/tools/attributetools.py:102: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if (value.shape is () and
./psychopy/visual/filters.py:60: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if gratType is "none":
./psychopy/visual/filters.py:63: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif gratType is "sin":
./psychopy/visual/filters.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif gratType is "ramp":
./psychopy/visual/filters.py:68: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif gratType is "sqr":  # square wave (symmetric duty cycle)
./psychopy/visual/filters.py:71: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif gratType is "sinXsin":
./psychopy/visual/elementarray.py:244: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif self.fieldShape is 'circle':
./psychopy/visual/shape.py:146: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if (lineColor is (1.0, 1.0, 1.0)  # check if exactly as the default arg
./psychopy/iohub/datastore/util.py:452: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if len(result) is not 1:
./psychopy/iohub/devices/__init__.py:141: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if d[0] is not '_' and d not in ['asNumpyArray', ]:
@isolver isolver self-assigned this Jan 14, 2021
isolver added a commit to isolver/psychopy that referenced this issue Jan 16, 2021
Switched to == or != as needed. Stops python 3.8 generating syntax warnings.
peircej added a commit that referenced this issue Jan 17, 2021
@isolver isolver closed this as completed Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants