bpo-35766: compile(): rename feature_version parameter#13994
bpo-35766: compile(): rename feature_version parameter#13994vstinner merged 1 commit intopython:masterpython/cpython:masterfrom vstinner:compile_feature_versionCopy head branch name to clipboard
Conversation
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.
|
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: |
ilevkivskyi
left a comment
There was a problem hiding this comment.
Again, as I said I am fine with this.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
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>
|
GH-13995 is a backport of this pull request to the 3.8 branch. |
|
Note: I saw that importlib has a source_to_code() which has a keyword-only "private" parameter: parameter called "_optimize", and the 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 ;-) |
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.
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.
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