Skip to content

Fix SyntaxWarning: "is" with a literal.#524

Merged
rmorshea merged 1 commit intoipython:masterfrom
frenzymadness:fix_syntax_warnings
May 28, 2019
Merged

Fix SyntaxWarning: "is" with a literal.#524
rmorshea merged 1 commit intoipython:masterfrom
frenzymadness:fix_syntax_warnings

Conversation

@frenzymadness
Copy link
Copy Markdown
Contributor

When using ipython with Python 3.8.0a4 I discovered this problem in traitlets library.

Reproducer:

Python 3.8.0a4 (default, May 17 2019, 21:21:00) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import traitlets.config.loader
/home/lbalhar/Software/traitlets/traitlets/config/loader.py:921: SyntaxWarning: "is" with a literal. Did you mean "=="?
  keys = ('-'+key, '--'+key) if len(key) is 1 else ('--'+key, )
/home/lbalhar/Software/traitlets/traitlets/config/loader.py:946: SyntaxWarning: "is" with a literal. Did you mean "=="?
  keys = ('-'+key, '--'+key) if len(key) is 1 else ('--'+key, )
>>>

@frenzymadness
Copy link
Copy Markdown
Contributor Author

Travis errors don't seem to be related to these changes.

@rmorshea
Copy link
Copy Markdown
Contributor

@frenzymadness thanks!

@rmorshea rmorshea merged commit c5c9166 into ipython:master May 28, 2019
@Carreau Carreau added this to the 5.0 milestone Jun 4, 2020
@Carreau Carreau added 5.0-re-review Need to re-review for potential API impact changes. 5.0-no-incidence change that has noincidence on 5.0 compat (eg: doc) and removed 5.0-re-review Need to re-review for potential API impact changes. labels Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0-no-incidence change that has noincidence on 5.0 compat (eg: doc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants