
https://gitlab.com/edneville/please (a sudo alternative)
cultural reviewer and dabbler in stylistic premonitions

https://gitlab.com/edneville/please (a sudo alternative)
Isn’t this an old tweet? Why is there no date on it.
i searched for the username; the tweet is from ~42 hours prior to this lemmy post.


Idk it works for me.
I don’t think there is any possible value for the sign variable which would make that if statement do anything other than raise a TypeError.
Also
"8:00:00" > "10:00:00"
but "08:00:00" < "10:00:00". comparing timestamps as strings is weird but actually works, as long as the hour is zero-padded :)
the problem with this code is that & (bitwise AND) has higher operator precedence than and == do, so it is first trying to bitwise AND "10:00:00" with sign (which i’m assuming would also be a string) and that will always raise a TypeError.
to do what the author appears to have intended to do, they would either need use parenthesis around both comparisons to actually bitwise AND their results, or (better) to use the boolean AND operator (and) instead of &.
The boolean and operator is the right tool for the job, and since it is lower precedence it also wouldn’t require that any parenthesis be added here.


TypeError: unsupported operand type(s) for &: 'str' and 'str'
you need to use the
echocommand if you want to echo something:alias thanks="echo 'You are most welcomed'"(the inner single-quotes are not strictly required in this case, but recommended nonetheless)