Title: Use boolean instead of 0/1 for condition check · Issue #93991 · python/cpython · GitHub
Open Graph Title: Use boolean instead of 0/1 for condition check · Issue #93991 · python/cpython
X Title: Use boolean instead of 0/1 for condition check · Issue #93991 · python/cpython
Description: Feature or enhancement In Lib/filecmp.py, line 160, we use a variable ok to check a condition. We use 0/1 to denote false/true here. A better coding style is using False/True. Pitch First, using True/False itself is a better coding style...
Open Graph Description: Feature or enhancement In Lib/filecmp.py, line 160, we use a variable ok to check a condition. We use 0/1 to denote false/true here. A better coding style is using False/True. Pitch First, using Tr...
X Description: Feature or enhancement In Lib/filecmp.py, line 160, we use a variable ok to check a condition. We use 0/1 to denote false/true here. A better coding style is using False/True. Pitch First, using Tr...
Opengraph URL: https://github.com/python/cpython/issues/93991
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use boolean instead of 0/1 for condition check","articleBody":"**Feature or enhancement**\r\n\r\nIn Lib/filecmp.py, [line 160](https://github.com/python/cpython/blob/2d33d217aaf68fd8dc5d3eebc048baf82924c18a/Lib/filecmp.py#L160), we use a variable `ok` to check a condition. We use 0/1 to denote false/true here. A better coding style is using False/True.\r\n\r\n\r\n**Pitch**\r\n\r\nFirst, using True/False itself is a better coding style.\r\n\r\nSecond, `if 1` is slower than `if True` (although the difference is small).\r\n\r\n\r\n**Previous discussion**\r\n\r\nN/A\r\n","author":{"url":"https://github.com/leikdga","@type":"Person","name":"leikdga"},"datePublished":"2022-06-18T17:36:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/93991/cpython/issues/93991"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5993d315-4d36-b243-8134-d22b2f3c60b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D040:1D9151:9571DF:C6BEF0:69697DB0 |
| html-safe-nonce | 9fec3ac4ccf9f94a766a9472a3f0ac8d4510d0a4967a6a6fe749fba69f1536dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDQwOjFEOTE1MTo5NTcxREY6QzZCRUYwOjY5Njk3REIwIiwidmlzaXRvcl9pZCI6IjE2Nzc5ODc4MzM5MDYyOTgyODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | edb4d0d697e4ad0e7c9075f068f8fed553d20e39f8cee69dbddbd92a7d253f5b |
| hovercard-subject-tag | issue:1275843092 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/93991/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31933537b8f3096137f143cb301539bb773f4765a1bfa1151faad575f56bec6a/python/cpython/issues/93991 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31933537b8f3096137f143cb301539bb773f4765a1bfa1151faad575f56bec6a/python/cpython/issues/93991 |
| og:image:alt | Feature or enhancement In Lib/filecmp.py, line 160, we use a variable ok to check a condition. We use 0/1 to denote false/true here. A better coding style is using False/True. Pitch First, using Tr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leikdga |
| hostname | github.com |
| expected-hostname | github.com |
| None | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width