Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-35766: compile(): rename feature_version parameter #13994

Merged
merged 1 commit into from Jun 12, 2019

Conversation

@vstinner
Copy link
Member

commented Jun 12, 2019

Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.

https://bugs.python.org/issue35766

bpo-35766: compile(): rename feature_version parameter
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.
@vstinner

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

I proposed this change to make the further changes that I proposed in PR #13992. The PR #13992 introduced an inconsistency between ast.parse() and compile() API for feature_version. So I propose to make compile() feature_version private. Anyway, the parameter only makes sense for ast.parse() anyway, and it's undocumented on purpose.

I skipped the NEWS entry since feature_version is not documented on purpose:
https://docs.python.org/dev/library/functions.html#compile

@ilevkivskyi
Copy link
Contributor

left a comment

Again, as I said I am fine with this.

@vstinner vstinner merged commit efdf6ca into python:master Jun 12, 2019

4 of 5 checks passed

Azure Pipelines PR in progress
Details
bedevere/issue-number Issue number 35766 found
Details
bedevere/news "skip news" label found
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

commented Jun 12, 2019

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

@vstinner vstinner deleted the vstinner:compile_feature_version branch Jun 12, 2019

miss-islington added a commit to miss-islington/cpython that referenced this pull request Jun 12, 2019
bpo-35766: compile(): rename feature_version parameter (pythonGH-13994)
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.
(cherry picked from commit efdf6ca)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
@bedevere-bot

This comment has been minimized.

Copy link

commented Jun 12, 2019

GH-13995 is a backport of this pull request to the 3.8 branch.

@vstinner

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

Note: I saw that importlib has a source_to_code() which has a keyword-only "private" parameter: parameter called "_optimize", and the "_" prefix in Python stands for "private thing". I reused the idea here ;-)

We might make the parameter public later if needed, but I would prefer to accept the feature_version=(3, 6) format in that case. Right now, it's not needed, so I just made it private ;-)

vstinner added a commit to vstinner/cpython that referenced this pull request Jun 12, 2019
bpo-35766: compile(): rename feature_version parameter (pythonGH-13994)
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.

(cherry picked from commit efdf6ca)
vstinner added a commit that referenced this pull request Jun 12, 2019
bpo-35766: compile(): rename feature_version parameter (GH-13994) (GH…
…-14001)

Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.

(cherry picked from commit efdf6ca)
PatrikKopkan pushed a commit to PatrikKopkan/cpython that referenced this pull request Sep 6, 2019
bpo-35766: compile(): rename feature_version parameter (pythonGH-13994)
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.
lisroach added a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
bpo-35766: compile(): rename feature_version parameter (pythonGH-13994)
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.