Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
stop68046yTrue == 1
False == 0
every object that doesnt overrides the __bool__ or the __eq__ method is usually True. -
Type coercion is debatable but most of the time pretty cool. isinstance(True, int) == True is just plain stupid
-
And this is why i always say that learning c as a first language will help a lot in the future
-
Froot75406yIt's quite reasonable I think. Allows for some Boolean sorcery like additions and multiplications
Edit: don't do that tho. Your senior dev will murder you -
@Excessive Keep in mind that most of the time that's highly implementation dependent
-
Parzi86695yyup
several langs use 0 and 1 internally as False and True, respective, so this isn't surprising.
Related Rants
-
dder25We need more JS devs for our frontend. After half a year of PM complaining that he doesn’t find devs, he fi...
-
EmberQuill4My team handles infrastructure deployment and automation in the cloud for our company, so we don't exactly dev...
-
Trithon5My code broke for no reason. I added a log statement to see why. *tests code* It worked.... What the 何?!
Just found out that in Python, bools are ints.
WTF
rant
wk155