bpo-35766: Change format for feature_version to (major, minor)#13992
bpo-35766: Change format for feature_version to (major, minor)#13992miss-islington merged 1 commit into
Conversation
(A single int is still allowed, but undocumented.)
vstinner
left a comment
There was a problem hiding this comment.
You may also update test_type_comments (like replace highest = sys.version_info[1] with highest = sys.version_info[:2]).
Sorry, something went wrong.
|
I'm feeling I'm being punished for something. All this is just boring work
and the reason (future compatibility) seems questionable. Can you please
reconsider the demand that this be changed?
|
Sorry, something went wrong.
ilevkivskyi
left a comment
There was a problem hiding this comment.
LGTM. Supporting both ways during some transitional period makes sense.
Sorry, something went wrong.
|
Thanks @gvanrossum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
…nGH-13992) (A single int is still allowed, but undocumented.) https://bugs.python.org/issue35766 (cherry picked from commit 10b55c1) Co-authored-by: Guido van Rossum <guido@python.org>
|
Oh, did I just effectively merge this? That was a surprise! I didn't know auto-merge works this way. |
Sorry, something went wrong.
|
I am also fine with the current way of things, so I would be happy to just revert this as well if it is to much work to switch to tuple. |
Sorry, something went wrong.
|
Oh, I was working on an PR including my proposed changes when @ilevkivskyi merged this PR. Well, that's fine. This PR fix my request, thanks @gvanrossum!
I like the new API :-) I'm fine with keeping support for feature_version=int. At least, new code can be written using tuple, and it becomes possible to plan a deprecation plan if anyone cares of abandon the old format. I proposed PR #13994 to make the further changes that I proposed. This change 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. |
Sorry, something went wrong.
) (GH-13993) (A single int is still allowed, but undocumented.) https://bugs.python.org/issue35766 (cherry picked from commit 10b55c1) Co-authored-by: Guido van Rossum <guido@python.org>
|
Guido:
Oh sorry, it wasn't my intent. I just questioned the API. I didn't have the opportunity to have a look at it previously, but IMHO it's still ok to change it before Python 3.8. After 3.8 final release, it will be more painful to change the API. I was fine with doing the changes myself, but you was faster than me and directly proposed a PR ;-) Anyway, my request is now addressed and I merged further minor changes (reviewed by @ilevkivskyi). I like the clever trick of keeping feature_version=int as an undocumented feature, for backward compatibility. I'm fine with that, I don't want to break the backward compatibility, but just advice to start with (3, 6) for new code. Thanks everyone, "typed AST" looks like a great feature! |
Sorry, something went wrong.
…nGH-13992) (A single int is still allowed, but undocumented.) https://bugs.python.org/issue35766
(A single int is still allowed, but undocumented.)
https://bugs.python.org/issue35766