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 — bpo-15999: Clean up of handling boolean arguments. by serhiy-storchaka · Pull Request #15610 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 30, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Use the 'p' format unit instead of manually called PyObject_IsTrue().
  • Pass boolean value instead 0/1 integers to functions that needs boolean.
  • Convert some arguments to boolean only once.

https://bugs.python.org/issue15999

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
bpo-15999: Clean up of handling boolean arguments.
843cfc3
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
@serhiy-storchaka serhiy-storchaka added the skip news label Aug 30, 2019
@serhiy-storchaka
serhiy-storchaka requested a review from rhettinger as a code owner August 30, 2019 08:05
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Aug 30, 2019
@bedevere-bot bedevere-bot added the awaiting core review label Aug 30, 2019
@serhiy-storchaka
More changes.
d7dda90
@serhiy-storchaka
serhiy-storchaka requested review from 1st1, abalkin, asvetlov, pganssle and tiran as code owners August 30, 2019 08:23
sir-sigurd
sir-sigurd reviewed Aug 30, 2019
View reviewed changes
Comment thread Lib/codeop.py

def __call__(self, source, filename, symbol):
codeob = compile(source, filename, symbol, self.flags, 1)
codeob = compile(source, filename, symbol, self.flags, True)

@sir-sigurd sir-sigurd Aug 30, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's OK.

https://docs.python.org/3.9/library/functions.html#compile

The argument optimize specifies the optimization level of the compiler; the default value of -1 selects the optimization level of the interpreter as given by -O options. Explicit levels are 0 (no optimization; debug is true), 1 (asserts are removed, debug is false) or 2 (docstrings are removed too).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Aug 30, 2019

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is dont_inherit, not optimize.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sir-sigurd sir-sigurd Aug 30, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
Move some changes to separate PRs.
c75bd1f
@serhiy-storchaka
serhiy-storchaka merged commit 1f21eaa into python:master Sep 1, 2019
@serhiy-storchaka
serhiy-storchaka deleted the bool-cleanup branch September 1, 2019 09:16
@bedevere-bot bedevere-bot removed the awaiting core review label Sep 1, 2019
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
@serhiy-storchaka @lisroach
bpo-15999: Clean up of handling boolean arguments. (pythonGH-15610)
85d3a7b
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
@serhiy-storchaka @DinoV
bpo-15999: Clean up of handling boolean arguments. (pythonGH-15610)
5bb8ed5
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
@serhiy-storchaka @websurfer5
bpo-15999: Clean up of handling boolean arguments. (pythonGH-15610)
c77e08d
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
@serhiy-storchaka serhiy-storchaka mentioned this pull request Dec 3, 2022
Using new 'bool' format character #60203
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rhettinger rhettinger Awaiting requested review from rhettinger
@1st1 1st1 Awaiting requested review from 1st1
@abalkin abalkin Awaiting requested review from abalkin
@asvetlov asvetlov Awaiting requested review from asvetlov
@pganssle pganssle Awaiting requested review from pganssle
@tiran tiran Awaiting requested review from tiran
1 more reviewer
@sir-sigurd sir-sigurd sir-sigurd left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@serhiy-storchaka @sir-sigurd @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.