I’m looking for some teacherbased feedback here on Python’s bitwise and logical Boolean connectives.
Traditionally, I have taught my students about the existence, meaning, and function of and, or, ^, not.
More recently, I discovered that &, , ~ were substitutes for and, or, not. Or so I thought.
I’m realizing that the singlesymbol bitwise operators usually behave similarly to the logical one, but in the case of precedence of operations the bitwise versions are handled first, followed by the logical/traditional ones.
I believe order of precedence is:
~
&
^

not
and
or
My multiple choice question is this: In your professional opinion, what is ideal for an introductorylevel Python course?
A) Teaching only the logical not, and, or
B) Teaching only the bitwise ~, &, ^, 
C) Teaching both logical and bitwise
D) Other (please elaborate)
I believe these would have the same effect, but it’s important to know where & would be different from and. It could be confusing for complete beginners to Python, though.
I also teach mathematics, and I have to undo the PEMDAS order of operations taught to students to explain that multiplication and division are functionally equivalent and thus share precedence moving left to right.
Teaching them order of operations the first time in the primary grades is made easier by cutting away that abstraction, but we must make the correction later. The kids adapt to that pretty easily overall, but it is still annoying to them that they weren’t taught correctly in the first place.
That’s a classic teacher issue there: simplify for a better early understanding or be fully upfront from the start.
In my opinion, it is better to teach only the logical operators (and, or, not).
The bitwise operators are generally useless unless you are manipulating ints bitwise for some reason, or you are using sets. Python programmers never use the bitwise operators for any boolean stuff (though you could). Even xor ^, with no keyword equivalent, isn’t really used with bools.
So it’s best to not accidentally introduce bad practices, which could sometimes lead to confusing bugs.
See the very useful python documention, including an operator precedence table:
Also, did you know that and and or don’t have to return bools? (a mostly useless piece of information)
And poor context in my part about PEMDAS. Early learners learn “multiplication, then division” and are never presented with an expression that puts division first so that the issue of reading left to right isn’t presented at that time.
In upper grades, we have to correct that notion to explain that they take equal precedence.
My analogy here is that using & interchangeably with and is a similar bargain. Some hotshot will email me eight years after I have them in class and say that their professor vilified me for doing it wrong