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
-
stop68676yTrue == 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
-
Froot75566yIt'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
-
Parzi88335yyup
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...
-
VaderNT8Worst WTF dev experience? The login process from hell to a well-fortified dev environment at a client's site. ...
Just found out that in Python, bools are ints.
WTF
rant
wk155