github / github/codeql

LGTM.com - false positive : Values compared using 'is' when equivalence is not the same as identity. Use '==' instead.

Abierto
#5,617 1 comentario 0 reacciones 0 asignados Ver en GitHub
acknowledged false-positive not security Python
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**Description of the false positive**

"Values compared using 'is' when equivalence is not the same as identity. Use '==' instead.".
I know equivalence is not the same as identity here, I want to test for identity.
I may be misunderstanding the error, but I don't get why lgtm suggest that I use `==` instead of `is` here.
Using a sentinel object as a default value is a [common Python pattern](https://python-patterns.guide/python/sentinel-object/#sentinel-objects).

**URL to the alert on the project page on LGTM.com**
https://lgtm.com/projects/g/facebookresearch/hydra/snapshot/7b06f68ba1c8781906159486ab2a1df2b564dad0/files/hydra/initialize.py?sort=name&dir=ASC&mode=heatmap#xae22158192d12f0b:1

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.