[issue45368] ~(True) and ~(False) gives incorrect result

2021-10-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue45368] ~(True) and ~(False) gives incorrect result

2021-10-05 Thread Xavier Morel
Xavier Morel added the comment: > True is a boolean so ~True should return False according to me. That's be a BC break for no reason: if you want to invert a boolean you can just `not` it. > True is not the same as 1 For historical reasons, in Python it is: >>> bool.mro() [, , ] >>> True

[issue45368] ~(True) and ~(False) gives incorrect result

2021-10-04 Thread Narendra Madurkar
Narendra Madurkar added the comment: True is a boolean so ~True should return False according to me. True is not the same as 1 -- ___ Python tracker ___

[issue45368] ~(True) and ~(False) gives incorrect result

2021-10-04 Thread Eric V. Smith
Eric V. Smith added the comment: What were you expecting? I think those are correct. See: >>> ~1 -2 >>> ~0 -1 -- nosy: +eric.smith ___ Python tracker ___

[issue45368] ~(True) and ~(False) gives incorrect result

2021-10-04 Thread Narendra Madurkar
New submission from Narendra Madurkar : ~(True) returns -2 ~(False) returns -1 -- messages: 403190 nosy: nmadurkar priority: normal severity: normal status: open title: ~(True) and ~(False) gives incorrect result ___ Python tracker