Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
pansa2
· 5y ago · 0 comments
`3 <= a <= 5` expands to `3 <= a and a <= 5`. However, based on the examples NumPy seems to require `&` instead of `and` - I’m not sure why.
Comments
[–]
Pinus
5y ago
A type can't implement its own 'and' and 'or' operators. (Probably because it is non-obvious how to handle their short-circuiting behaviour.)