[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-13 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-13 Thread STINNER Victor


STINNER Victor  added the comment:

> It's fine to document the current state. I don't think you should spend any 
> time *changing* the API to "future-proof" it.

Ok.

> I am hoping that larger changes to the compiler implementation will happen 
> before Python 4, which will make the whole API moot (including the "parser" 
> module, which should be deprecated ASAP). The compiler is excluded from the 
> ABI for a reason.

Aha, that sounds exciting :-)

I created bpo-37268 to propose to deprecate the parser module in Python 3.8.

--

PyCompilerFlags changes are now documented. I made the small code changes that 
I wanted to do in 3.8 and master. I close the issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-13 Thread miss-islington


miss-islington  added the comment:


New changeset 032bf30643fff49b5595b53f9c1ce5b2cd2df504 by Miss Islington (bot) 
in branch '3.8':
bpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)
https://github.com/python/cpython/commit/032bf30643fff49b5595b53f9c1ce5b2cd2df504


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 022ac0a497b668d8b15e34e582a6396ead1a35e1 by Victor Stinner in 
branch 'master':
bpo-37253: Remove PyAST_obj2mod_ex() function (GH-14020)
https://github.com/python/cpython/commit/022ac0a497b668d8b15e34e582a6396ead1a35e1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13906
pull_request: https://github.com/python/cpython/pull/14044

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f9445a391e6a91103fbe88bff4d3adc07f526c73 by Victor Stinner in 
branch '3.8':
[3.8] bpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019) 
(GH-14038)
https://github.com/python/cpython/commit/f9445a391e6a91103fbe88bff4d3adc07f526c73


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread miss-islington


miss-islington  added the comment:


New changeset 92e836c7dcaf74f7b8617250414224d24d1eb1f2 by Miss Islington (bot) 
in branch '3.8':
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
https://github.com/python/cpython/commit/92e836c7dcaf74f7b8617250414224d24d1eb1f2


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

Many PyRun_xxx() functions of the public C API accept a "PyCompilerFlags* 
flags" parameter. So yeah, I documented the new cf_feature_version. 
PyCompilerFlags structure is kind of public ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13902
pull_request: https://github.com/python/cpython/pull/14038

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13901
pull_request: https://github.com/python/cpython/pull/14037

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a04ea4f92ccbe20ffdbb5fa9b6bb93ee8da50f5d by Victor Stinner in 
branch 'master':
bpo-37253: Fix typo in PyCompilerFlags doc (GH-14036)
https://github.com/python/cpython/commit/a04ea4f92ccbe20ffdbb5fa9b6bb93ee8da50f5d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 37d66d7d4bc7dbac9809d69966a774ebb32563be by Victor Stinner in 
branch 'master':
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
https://github.com/python/cpython/commit/37d66d7d4bc7dbac9809d69966a774ebb32563be


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13900
pull_request: https://github.com/python/cpython/pull/14036

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2c9b498759f4fc74da82a0a96d059d666fa73f16 by Victor Stinner in 
branch 'master':
bpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019)
https://github.com/python/cpython/commit/2c9b498759f4fc74da82a0a96d059d666fa73f16


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13899
pull_request: https://github.com/python/cpython/pull/14035

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

It's fine to document the current state. I don't think you should spend any 
time *changing* the API to "future-proof" it.

I am hoping that larger changes to the compiler implementation will happen 
before Python 4, which will make the whole API moot (including the "parser" 
module, which should be deprecated ASAP). The compiler is excluded from the ABI 
for a reason.

--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


STINNER Victor  added the comment:

> Something else, ast.parse() has been modified to use a (major, minor) version 
> tuple rather an integer to specify the Python version in feature_version, but 
> PyCompilerFlags still only uses the minor major. This API will be broken once 
> the Python major version will be increased to 4, no? Would it make sense to 
> use PY_VERSION_HEX format which includes the major version instead?

I can work on a PR to change cf_feature_version format, but I would prefer to 
agree here on what is the best format ;-)

Note: compile() has a private keyword-only _feature_version which is also the 
Python minor version (int): don't include the major version. If we change 
cf_feature_version, we may also change compile(_feature_version=N) format.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13885
pull_request: https://github.com/python/cpython/pull/14020

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13884
pull_request: https://github.com/python/cpython/pull/14019

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +13883
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14018

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37253] PyCompilerFlags got a new cf_feature_version field

2019-06-12 Thread STINNER Victor


New submission from STINNER Victor :

The commit dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c of bpo-35766 added a new 
cf_feature_version field to PyCompilerFlags. Each PyCompilerFlags variable must 
properly initialize this new field to PY_MINOR_VERSION. I propose to add a new 
_PyCompilerFlags_INIT macro to statically initialize such variable. I'm not 
sure if it should be public or not.

The PyCompilerFlags structure is excluded from the stable ABI (PEP 384), but 
it's documented in the "The Very High Level Layer" C API documentation:
https://docs.python.org/dev/c-api/veryhigh.html#c.PyCompilerFlags

Structure fields are documented there:

struct PyCompilerFlags {
int cf_flags;
}

The doc is outdated. I'm not sure if it's on purpose or not.

Moreover, the new PyCompilerFlags.cf_feature_version field is not documented in 
https://docs.python.org/dev/whatsnew/3.8.html#changes-in-the-c-api whereas C 
extensions using PyCompilerFlags should initialize cf_feature_version to 
PY_MINOR_VERSION?

I'm not sure if C extensions really *must* initialize cf_feature_version, since 
the field is only used if PyCF_ONLY_AST flag is set in the cf_flags field.

Something else, ast.parse() has been modified to use a (major, minor) version 
tuple rather an integer to specify the Python version in feature_version, but 
PyCompilerFlags still only uses the minor major. This API will be broken once 
the Python major version will be increased to 4, no? Would it make sense to use 
PY_VERSION_HEX format which includes the major version instead?

Or cf_feature_version could be a structure with major and minor fields, but 
that might be overkill?

--
components: Interpreter Core
messages: 345368
nosy: vstinner
priority: normal
severity: normal
status: open
title: PyCompilerFlags got a new cf_feature_version field
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com