Skip to content

Multiple binary | operation in a single statement failed with "E1131: unsupported operand type(s) for | (unsupported-binary-operation)" #7381

Open
@Wayonb

Description

@Wayonb

Bug description

If I am trying to OR more than two flags, pylint 2.15.0 fails with "E1131: unsupported operand type(s) for | (unsupported-binary-operation)". This worked with pylint 2.14.1

	class MosaicFlags(Flag):
		NONE = 0
		SUPPLY_MUTABLE = 1
		TRANSFERABLE = 2
		RESTRICTABLE = 4
		REVOKABLE = 8

value = MosaicFlags.SUPPLY_MUTABLE | MosaicFlags.RESTRICTABLE | MosaicFlags.REVOKABLE

Configuration

No response

Command used

python3 -m pylint --rcfile .pylintrc --load-plugins pylint_quotes

Pylint output

************* Module tests.test_RuleBasedTransactionFactory
tests/test_RuleBasedTransactionFactory.py:148:3: E1131: unsupported operand type(s) for | (unsupported-binary-operation)
tests/test_RuleBasedTransactionFactory.py:164:10: E1131: unsupported operand type(s) for | (unsupported-binary-operation)

Expected behavior

Expected no errors

Pylint version

pylint 2.15.0
Python 3.8.10

OS / Environment

Ubuntu 20.04

Additional dependencies

isort==5.10.1
pycodestyle==2.9.1
pylint==2.15.0
pylint-quotes==0.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationRegression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions