Bitwise Operators

I’m a very nascent programmer, and I’ve run across integer bitwise operators. Im wondering how prevalent these are in the current python world, and if anyone has examples of using them in code.
Is this something I should make a serious effort to understand, or is it more obscure in modern programming and I should just make a note of it and move on?
Thank you.

Make a note and move on. As soon as it is required for a problem you want to solve you can learn about it,


Thank you for your time

As Barry wrote you do not need to study them at the beginning but it is good to know that they exist. You will need these operations only in very special cases like:

  • working with tight data structures - low-level graphics operations, binary communication protocols, encodings and formats
  • implementing fast computational algorithms (e.g. for cryptography)

Bitwise operators treat int’s like a bit string. Each bit is 0 or 1 * a power of 2. Experimenting with the values and operators and Python int to binary string? - Stack Overflow may be helpful in understanding them, should you ever actually need to.

Their use was common back when assembly language was the best way to squeeze performance out of a CPU, but they have grown uncommon. I rarely delve below the level of Cython anymore, let alone C or assembler.

The last time I used bitwise operators was writing a bloom filter in Python. It’s a probabilistic set datastructure. It’s pretty niche, and there are multiple implementations of them on pypi.