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

Error when chaining more than two Q objects #387

Open
rvanlaar opened this issue Dec 6, 2022 · 2 comments
Open

Error when chaining more than two Q objects #387

rvanlaar opened this issue Dec 6, 2022 · 2 comments

Comments

@rvanlaar
Copy link

rvanlaar commented Dec 6, 2022

When chaining more than two Q Objects I get an E1131: unsupported operand type(s) for | (unsupported-binary-operation)`.
I created a code example:

from django.db.models import Q

from django.contrib.auth.models import Permission


def pylint_alright():
    Permission.objects.filter(Q(pk=1) | Q(pk=2))


def pylint_error():
    # ************* Module app.scratch
    # scratch.py:13:30: E1131: unsupported operand type(s) for | (unsupported-binary-operation)
    Permission.objects.filter(Q(pk=1) | Q(pk=2) | Q(pk=3))

freeze:

amqp==2.6.1 
arabic-reshaper==2.1.4 
arrow==1.2.3 
asgiref==3.5.2 
asn1crypto==1.5.1 
babel==2.11.0 
billiard==3.6.4.0 
bleach==3.3.1 
celery==4.4.0 
certifi==2022.9.24 
cffi==1.15.1 
charset-normalizer==2.1.1 
click==8.1.3 
colorama==0.4.6 
cryptography==38.0.4 
cssselect2==0.7.0 
defusedxml==0.7.1 
deprecated==1.2.13 
django-appconf==1.0.5 
django-axes==5.39.0 
django-celery-email==3.0.0 
django-classy-tags==4.0.0 
django-cms==3.11.0 
django-countries==7.2.1 
django-elasticsearch-dsl==7.2.2 
django-environ==0.7.0 
django-filer==2.2.3 
django-filter==2.4.0 
django-formtools==2.4 
django-hamlpy==1.4.4 
django-ipware==4.0.2 
django-js-asset==2.0.0 
django-localflavor==3.1 
django-modeltranslation==0.17.7 
django-mptt==0.14.0 
django-multiselectfield==0.1.11 
django-npm==1.0.0 
django-oauth-toolkit==1.7.1 
django-phonenumber-field[phonenumbers]==4.0.0 
django-polymorphic==3.1.0 
django-recaptcha==3.0.0 
django-sekizai==2.0.0 
django-tinymce4-lite==1.8.0 
django-treebeard==4.5.1 
django==3.2.16 
djangocms-admin-style==3.2.0 
djangocms-attributes-field==2.0.0 
djangocms-file==3.0.0 
djangocms-link==3.0.0 
djangocms-picture==4.0.0 
djangocms-text-ckeditor==5.0.1 
djangorestframework-xml==2.0.0 
djangorestframework==3.13.1 
djangosaml2==1.5.4 
djangosaml2idp==0.7.2 
docutils==0.16 
easy-thumbnails==2.8.3 
easy-thumbnails[svg]==2.8.3 
elasticsearch-dsl==7.4.0 
elasticsearch==7.17.7 
elementpath==3.0.2 
factory-boy==3.2.1 
faker==15.3.4 
future==0.18.2 
greenlet==2.0.1 
gunicorn==20.1.0 
hashids==1.3.1 
html5lib==1.1 
idna==3.4 
jsmin==3.0.1 
jsonpickle==1.5.2 
jwcrypto==1.4.2 
kombu==4.6.11 
lxml==4.9.1 
oauthlib==3.2.2 
oscrypto==1.3.0 
packaging==21.3 
phonenumbers==8.13.1 
pillow==9.3.0 
psycopg2==2.9.5 
pycparser==2.21 
pyhanko-certvalidator==0.19.6 
pyhanko==0.15.1 
pyopenssl==21.0.0 
pyparsing==3.0.9 
pypdf3==1.0.6 
pysaml2==7.2.1 
python-bidi==0.4.2 
python-dateutil==2.8.2 
python-memcached==1.59 
python-stdnum==1.18 
pytz-deprecation-shim==0.1.0.post0 
pytz==2022.6 
pyyaml==6.0 
qrcode==7.3.1 
regex==2022.10.31 
reportlab==3.5.63 
requests==2.28.1 
sentry-sdk==1.11.1 
setuptools==65.6.3 
six==1.16.0 
sqlalchemy==1.4.44 
sqlparse==0.3.1 
svglib==1.4.1 
tinycss2==1.2.1 
tqdm==4.64.1 
tzdata==2022.7 
tzlocal==4.2 
unidecode==1.1.2 
uritools==4.0.0 
urllib3==1.26.13 
vine==1.3.0 
webencodings==0.5.1 
wheel==0.38.4 
whitenoise==5.0.1 
wrapt==1.14.1 
xhtml2pdf==0.2.8 
xmlschema==2.1.1 
@JonnoFTW
Copy link

I can confirm this issue occurs with:

pylint==2.15.10
pylint-django==2.5.3

@Igetin
Copy link

Igetin commented Feb 23, 2023

Can also confirm on Pylint 2.16.2 and pylint-django 2.5.3.

Related: pylint-dev/pylint#7381

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

3 participants