GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use boolean instead of 0/1 for condition check · Issue #93991 · python/cpython

Use boolean instead of 0/1 for condition check #93991

New issue
Copy link
New issue
Copy link
Closed
Closed
Use boolean instead of 0/1 for condition check#93991
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@leikdga
leikdga
opened on Jun 18, 2022
Issue body actions

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.

Second, if 1 is slower than if True (although the difference is small).

Previous discussion

N/A

Activity

  1. leikdga
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Jun 18, 2022
  2. leikdga
    changed the title [-]Use boolean instead of 0/1 for condition[/-] [+]Use boolean instead of 0/1 for condition check[/+] on Jun 18, 2022
  3. aramcpp
    added a commit that references this issue on Jun 19, 2022

    pythongh-93991: Changed condition check to boolean instream of 0/1

    41a0b92
  4. miss-islington
    added a commit that references this issue on Jun 19, 2022

    gh-93991: Use boolean instead of 0/1 for condition check (GH-93992)

    476d302
  5. alex
    closed this as completedon Jun 19, 2022
  6. serhiy-storchaka
    added a commit that references this issue on Jun 26, 2022

    Revert 30935 defer bpo45162 to 312 (#94285)

    1ffde3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.