[Python-Dev] Re: Declarative imports

2022-04-08 Thread Victor Stinner
While it's different than you proposal, some people may like this magic "smart imports" project which lazily imports a module when it's used :-) Project: https://pypi.org/project/smart-imports/ Replace: --- import math from my_project import calc # 100500 other imports def my_code(argument, fun

[Python-Dev] Re: Accepting PEP 670 – Convert macros to functions in the Python C API

2022-04-18 Thread Victor Stinner
PEP 670 – Convert macros to functions in the Python C API: https://peps.python.org/pep-0670/ That's great! Thanks to everyone who was involved in PEP 670: the feedback helped Erlend and me to write a better PEP. It was a long journey, Erlend started the first discussion about macros in March 2021!

[Python-Dev] Re: Do you ever use ceval.c's LLTRACE feature?

2022-04-18 Thread Victor Stinner
Hi, In 2017, I proposed to document the feature, but nobody was volunteer to write the doc (issue still open): https://bugs.python.org/issue25571 I added a bare minimum mention of this feature in the "Python Debug Build" documentation: https://docs.python.org/dev/using/configure.html#python-debug

[Python-Dev] Re: Slowly bend the C API towards the limited API to get a stable ABI for everyone

2022-04-19 Thread Victor Stinner
6 months ago, I wrote a different document based on HPy Manifesto: "PEP: Taking the Python C API to the Next Level" https://mail.python.org/archives/list/python-dev@python.org/message/RA7Q4JAUEITJBOUAXFEJKRRM2RR3QSZI/ Victor On Mon, Apr 4, 2022 at 5:20 PM Petr Viktorin wrote: > > On 03. 02. 22

[Python-Dev] Re: Slowly bend the C API towards the limited API to get a stable ABI for everyone

2022-04-20 Thread Victor Stinner
On Wed, Apr 20, 2022 at 10:03 AM Antoine Pitrou wrote: > If the HPy design is the long term goal, why not just recommend that > people use HPy? And keep the C API for expert users with specific > needs that are not accomodated by HPy. > > To me, it seems that trying to change the C API to be "lik

[Python-Dev] Re: Slowly bend the C API towards the limited API to get a stable ABI for everyone

2022-04-20 Thread Victor Stinner
On Wed, Apr 20, 2022 at 1:44 PM Antoine Pitrou wrote: > > For consumers of the C API (C extensions, Cython, pybind11, etc.), > > once most implementation details will be hidden, the C API will become > > way more stable. > > The *API* is quite stable already if you don't use the private/internal >

[Python-Dev] Re: C API: Move PEP 523 "Adding a frame evaluation API to CPython" private C API to the internal C API

2022-04-25 Thread Victor Stinner
On Fri, Apr 22, 2022 at 2:52 PM Fabio Zadrozny wrote: > Humm, now I'm a bit worried... the approach the debugger is using gets the > PyFrameObject that's about to be executed and changes the > PyFrameObject.f_code just before the execution so that the new code is > executed instead. You can al

[Python-Dev] Re: Proposal to deprecate mailcap

2022-04-26 Thread Victor Stinner
On Tue, Apr 26, 2022 at 5:47 AM Brett Cannon wrote: > After talking about this in the SC today, we agreed to deprecate mailcap > under the auspices of PEP 594: > https://github.com/python/peps/commit/701999a91dc5f976c00d5bde1510226ebd9c7822 > . Good. I proposed https://github.com/python/cpytho

[Python-Dev] Add -P command line option to not add sys.path[0]

2022-04-26 Thread Victor Stinner
Hi, There are 4 main ways to run Python: (1) python -m module [...] (2) python script.py [...] (3) python -c code [...] (4) python [...] (1) and (2) insert the directory of the module/script at sys.path[0]. (3) and (4) insert an empty string at sys.path[0]. This behavior is convenient and is ma

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-26 Thread Victor Stinner
The only purpose of proposed -P option is to "not add sys.path[0]". There are use cases which only need that. Victor On Tue, Apr 26, 2022 at 8:37 PM Steve Dower wrote: > > On 4/26/2022 10:46 AM, Victor Stinner wrote: > > I propose adding a -P option to Python command

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-27 Thread Victor Stinner
On Tue, Apr 26, 2022 at 8:37 PM Steve Dower wrote: > The biggest issue I see is that the obvious command line options for > "import site" are already used to imply "do not import site". But then, > -P isn't obvious either. Maybe an -X option would suffice? I propose the short option "-P" rather t

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-27 Thread Victor Stinner
On Tue, Apr 26, 2022 at 11:46 AM Victor Stinner wrote: > I propose adding a -P option to Python command line interface to "not > add sys.path[0]": > https://github.com/python/cpython/pull/31542 My plan is to merge this change at 2022-05-05, the day before the Python 3.11 fea

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-27 Thread Victor Stinner
Oh sorry, I mean that I prefer to *not* add an environment variable, but I'm not strongly against it. How would the environment varaible be used? A command line option is not enough? Victor On Wed, Apr 27, 2022 at 4:44 PM Antoine Pitrou wrote: > > On Tue, 26 Apr 2022 11:46:41 +02

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-27 Thread Victor Stinner
Since I didn't get any serious review on my pull request since February, I created this thread on python-dev to get more people looking into this issue. On Wed, Apr 27, 2022 at 5:30 PM Paul Moore wrote: > > On Wed, 27 Apr 2022 at 15:32, Victor Stinner wrote: > > > > On

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-27 Thread Victor Stinner
s like use cases are different enough to justify two options, no? Victor On Tue, Apr 26, 2022 at 11:52 PM Victor Stinner wrote: > The only purpose of proposed -P option is to "not add sys.path[0]". > There are use cases which only need that. > > Victor > > On Tue, Apr

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-04-27 Thread Victor Stinner
On Wed, Apr 27, 2022 at 5:56 PM Antoine Pitrou wrote: > An environment variable is an easy to influence a program or system > whose inner workings you don't control (for example a system that > spawns child Python processes). And it sounds like a good idea to allow > that given that it improves se

[Python-Dev] Using the Python C API in C++

2022-04-27 Thread Victor Stinner
Hi, If you got issues with using the Python C API in C++, please speak up! I'm looking for feedback :-) Extending Python by writing C++ code is now easy with the pybind11 project: https://pybind11.readthedocs.io/ It seems like over the last years, building C++ extensions with the Python C API s

[Python-Dev] Re: Using the Python C API in C++

2022-04-28 Thread Victor Stinner
Since we are you talking about tests, we can easily run the tests on multiple C++ versions. But we have to start somewhere, so I propose to start with C++11. More C++ versions can be tested later. Victor On Thu, Apr 28, 2022 at 5:54 AM wrote: > > > In terms of C++ version, it was proposed to tar

[Python-Dev] Re: Using the Python C API in C++

2022-04-28 Thread Victor Stinner
Recently, a issue about C++20 compatibility was reported: "The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword" https://github.com/python/cpython/issues/83536 In fact, after a long study, Python C API is *not* affected by this issue. Usi

[Python-Dev] Re: Using the Python C API in C++

2022-04-29 Thread Victor Stinner
Hi, The C++ version was discussed in the 2nd link that I gave in my first message: https://github.com/python/cpython/issues/91321 Gregory wrote "If we can conditionally test new things based on C++XX version, accumulating modern issue regression tests seems useful. Otherwise 11 at minimum." Anot

[Python-Dev] Re: PEP 689 – Semi-stable C API tier

2022-04-29 Thread Victor Stinner
Ok, let me start with the serious business: API name. I'm not comfortable with "semi-stable". Python already has a "limited API" and a "stable ABI". Just by its name, it's unclear what "semi-stable" means. Honestly, I would be more comfortable with the name: "unstable API". It would be clear that

[Python-Dev] Re: PEP 689 – Semi-stable C API tier

2022-04-29 Thread Victor Stinner
> Rejected Ideas > == > > It might be good to add a similar tier in the Python (not C) API, > e.g. for ``types.CodeType``. > However, the opt-in mechanism would need to be different (if any). > This is outside the scope of the PEP. For types.CodeType constructor, would it be possible t

[Python-Dev] Re: PEP 689 – Semi-stable C API tier

2022-04-29 Thread Victor Stinner
I think that the main advantage of "unstable" over "semi-stable" is that it's a single word :-D It avoids the really hard question (!) about the separator between "semi" and "stable" ;-) (semistable? semi-stable? semi_stable?). Victor ___ Python-Dev mail

[Python-Dev] Re: Summary of Python tracker Issues

2022-04-30 Thread Victor Stinner
On Fri, Apr 29, 2022 at 8:12 PM Python tracker wrote: > ACTIVITY SUMMARY (2022-04-22 - 2022-04-29) > Python tracker at https://bugs.python.org/ > > To view or respond to any of the issues listed below, click on the issue. > Do NOT respond to this message. > > Issues counts and deltas: > open

[Python-Dev] Re: Using the Python C API in C++

2022-05-02 Thread Victor Stinner
Hi, I merged the best basic tests to make sure that using the Python C API in C++ does not emit compiler warnings: * Code: https://github.com/python/cpython/blob/main/Lib/test/_testcppext.cpp * Test: https://github.com/python/cpython/blob/main/Lib/test/test_cppext.py The code is only built to ch

[Python-Dev] Re: Using the Python C API in C++

2022-05-03 Thread Victor Stinner
;t modify the memory. But maybe tomorrow, the implementation will deeply change and will need to modify the memory. In C, using "const" (for something other than const char*) is just not convenient. Victor On Tue, May 3, 2022 at 9:22 AM Antoine Pitrou wrote: > On Mon, 2 May 2022 15:2

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-05-04 Thread Victor Stinner
Hi, I updated my PR https://github.com/python/cpython/pull/31542 and I plan to merge it soon. It seems like most people need and like this feature. About the feature name, nobody liked the "add_path0" name which is misleading: "path0" is not easy to get, and the path is prepended, not added. I

[Python-Dev] Re: Can I ask a real dumb procedural question about GitHub email?

2022-05-05 Thread Victor Stinner
Every day, I unsubscribe from many issues and pull requests to reduce the number of emails to move it below my acceptable threshold. For example, for me, 20 new discussions per day is acceptable, whereas 100 is not. I prefer to focus on small number of things and follow them closely. Victor _

[Python-Dev] Re: Add -P command line option to not add sys.path[0]

2022-05-05 Thread Victor Stinner
file importing the site module, > maybe a different option can be added, no? Adding -P doesn't prevent > that. But it seems like use cases are different enough to justify two > options, no? > > Victor > > > On Tue, Apr 26, 2022 at 11:52 PM Victor Stinner wrote: > >

[Python-Dev] Re: [python-committers] Release of Python 3.11 beta 1 is currently blocked

2022-05-06 Thread Victor Stinner
On Fri, May 6, 2022 at 2:14 PM Pablo Galindo Salgado wrote: > Today we need to start the release of Python 3.11 beta 1. Currently, we have > the following blockers: > > * https://github.com/python/cpython/issues/91162 (was deferred blocker - but > all deferred blockers are bumped to release bloc

[Python-Dev] Test Python 3.11 beta1 with PYTHONSAFEPATH=1

2022-05-09 Thread Victor Stinner
Hi, I added the -P command line option and the PYTHONSAFEPATH=1 environment variable to Python 3.11 beta 1 to not prepend an "unsafe path" to sys.path such as the script's directory or the current directory: https://docs.python.org/dev/using/cmdline.html#cmdoption-P Example: -- $ echo 'N

[Python-Dev] Migration plan for the distutils removal in Python 3.12

2022-05-10 Thread Victor Stinner
Hi, Two years ago, PEP 632 "Deprecate distutils module" was accepted: the distutils package was deprecated in Python 3.10 and scheduled for removal in Python 3.12. Questions. * Is the Python ecosystem ready for the distutils removal? How many projects are expected to be broken by this removal? *

[Python-Dev] Re: Migration plan for the distutils removal in Python 3.12

2022-05-10 Thread Victor Stinner
On Tue, May 10, 2022 at 11:28 AM Christian Heimes wrote: > > Right now, Python still uses distutils internally for multiple use > > cases. I propose to start with renaming the distutils package to > > _distutils in the stdlib: > > > > * https://github.com/python/cpython/issues/92584 > > * https://

[Python-Dev] Re: Migration plan for the distutils removal in Python 3.12

2022-05-10 Thread Victor Stinner
On Tue, May 10, 2022 at 5:33 PM Christian Heimes wrote: > We can easily take care of test_cppext and add the build step to > Makefile. What matters in test_cppext is that using the Python C API in C++ does not emit compiler warnings, so it uses -Werror. Since this test is very new, I would prefer

[Python-Dev] Re: Migration plan for the distutils removal in Python 3.12

2022-05-10 Thread Victor Stinner
On Tue, May 10, 2022 at 6:16 PM Steve Dower wrote: > I agree. The internal tools that use it are all in our Tools directory, > so we can move distutils there and explicitly add an import path to > locate it. No need to keep it in the stdlib (Lib/) at all. > > Migrating to Makefile builds is probab

[Python-Dev] Re: Migration plan for the distutils removal in Python 3.12

2022-05-10 Thread Victor Stinner
On Tue, May 10, 2022 at 7:18 PM Guido van Rossum wrote: > Shouldn't we wean our internal tools off this obsolete version of distutils > too, rather than just move it around? Here is a first PR to build the test C++ extension with setuptools in test_cppext: https://github.com/python/cpython/pull/

[Python-Dev] Re: Summary of Python tracker Issues

2022-05-15 Thread Victor Stinner
According to my notes, the summary is generated by this Python script: https://github.com/psf/bpo-tracker-cpython/blob/master/scripts/roundup-summary But I don't know what runs this script once a week. Victor On Fri, May 13, 2022 at 8:56 PM Brett Cannon wrote: > > Can we shut this down or unsub

[Python-Dev] New public PyUnicodeBuilder C API

2022-05-16 Thread Victor Stinner
Hi, I propose adding a new C API to "build an Unicode string". What do you think? Would it be efficient with any possible Unicode string storage and any Python implementation? PyPy has an UnicodeBuilder type in Python, but here I only propose C API. Later, if needed, it would be easy to add a Pyt

[Python-Dev] Re: New public PyUnicodeBuilder C API

2022-05-16 Thread Victor Stinner
On Mon, May 16, 2022 at 11:40 AM wrote: > Cython used the private _PyUnicodeWriter API (and stopped using it on Py3.11 > when it was hidden more thoroughly) I'm not aware of any change in the the private _PyUnicodeWriter API in Python 3.11. Is it just that Cython no longer wants to use private A

[Python-Dev] Re: New public PyUnicodeBuilder C API

2022-05-16 Thread Victor Stinner
On Mon, May 16, 2022 at 12:51 PM wrote: > > Victor Stinner wrote: > > On Mon, May 16, 2022 at 11:40 AM dw-...@d-woods.co.uk wrote: > > > Cython used the private _PyUnicodeWriter API (and stopped using it on > > > Py3.11 when it was hidden more thoroughly) > >

[Python-Dev] Re: New public PyUnicodeBuilder C API

2022-05-16 Thread Victor Stinner
On Mon, May 16, 2022 at 2:11 PM Antoine Pitrou wrote: > > PyUnicodeBuilder_Init(&builder); > > > > // Overallocation is more efficient if the final length is unknown > > PyUnicodeBuilder_EnableOverallocation(&builder); > > PyUnicodeBuilder_WriteStr(&builder, key);

[Python-Dev] Re: python3.110b1 fails during post compile setup on OpenBSD 7.1

2022-05-23 Thread Victor Stinner
Hi, Please report Python issues to the GitHub project: https://github.com/python/cpython/issues/ The OpenBSD operating system is currently not supported by Python, so don't expect a quick feedback: https://peps.python.org/pep-0011/ A few years ago, I tried to provide best effort support for Open

[Python-Dev] Re: Is it possible to view tokenizer output?

2022-05-30 Thread Victor Stinner
On Mon, May 30, 2022 at 1:40 AM Eric V. Smith wrote: > python -m tokenize < file-to-parse.py > > See the comment at the top of tokenize.py. IIRC, it re-implements the > tokenizer, it does not call the one used for python code. Ah right, I would be surprised that there would be a public Python API

[Python-Dev] Re: Is it possible to view tokenizer output?

2022-05-31 Thread Victor Stinner
h, or would you >> be willing to share the code? >> >> On 30/05/2022 16:23, Pablo Galindo Salgado wrote: >> >> There is no *public* one but there is a private one accesible from Python I >> added for testing purposes. >> >> On Mon, 30 May 2022, 15:17 Vic

[Python-Dev] Looking for volunteers to maintain the multiprocessing and concurrent.futures modules

2022-06-06 Thread Victor Stinner
Hi, On buildbots, it's common that we get at least one multiprocessing test failure per week. While I just reported a new one, I wanted to add a "expert-multiprocessing" label, but it didn't exist. I just created the label :-) https://github.com/python/cpython/labels/expert-multiprocessing I

[Python-Dev] Re: Accepting PEP 681 – Data Class Transforms

2022-06-06 Thread Victor Stinner
Hi, Side note: it would be nice to add "typing: " prefix or mention "type annotation" or "type check" in the title of PEPs which are about that. Just from the PEP title, it's hard *for me* to guess that it's about type annotations. Examples of other PEP titles which confused me: PEP 612 – Param

[Python-Dev] Re: Deadlock when interrupting interpreter initialisation with ptrace?

2022-06-06 Thread Victor Stinner
On Mon, Jun 6, 2022 at 4:35 PM Gabriele wrote: > The austinp variant is a variant of Austin > (https://github.com/P403n1x87/austin) for Linux that uses ptrace to > seize and interrupt/continue threads to capture native stack traces > using libunwind. During testing, I have discovered that there ar

[Python-Dev] Re: [Python-Help] Unable to bootstrap Python 3 install

2022-06-15 Thread Victor Stinner
Hi, While this problem is causing you a lot of troubles, I never had to cross compile Python, and I guess that it's the case for most people. Changing the Python build system and distutils is stressful since it can break Python for the majority of users, rather than leaving the minority of users w

[Python-Dev] Re: [Python-Help] Unable to bootstrap Python 3 install

2022-06-16 Thread Victor Stinner
On Thu, Jun 16, 2022 at 4:29 PM Xavier de Gaye wrote: > A Google search on "andoid x86_64" gives about 10,900,000 results, showing > that cross-compiling is quite common for the case where the build system and > the host system have the same PLATFORM_TRIPLET as when building android > x86_64 on

[Python-Dev] Re: [Python-Help] Unable to bootstrap Python 3 install

2022-06-17 Thread Victor Stinner
On Thu, Jun 16, 2022 at 7:54 PM Christian Heimes wrote: > What Victor means that we would like to have clear instructions how to > reproduce the problem ourselves. Could you please provide step by step > instructions how I could set up a build environment on a X86_64 PC with > a standard Linux dis

[Python-Dev] Re: Embedded Python Memory Leaks

2022-10-08 Thread Victor Stinner
Alexei is about about https://github.com/python/cpython/issues/96853 I suggest discussing the issue there. Victor On Thu, Oct 6, 2022 at 9:54 PM wrote: > > Hi Python team > > Is any plan to try and fix memory leaks when embedding Python in a C/C++ > application? > > Thanks in advance, > Alexei

[Python-Dev] Re: Switching to Discourse

2022-12-01 Thread Victor Stinner
What happened to this SC decision (move to Discourse)? People started again to write on python-dev. So what's going on? Should I reply on python-dev? Ask to move to Discourse? Should we *close* the python-dev mailing list? Victor ___ Python-Dev mailing

[Python-Dev] Re: Snapshot formats in tracemalloc vs profiler

2019-08-14 Thread Victor Stinner
ve logging/sampling heap profiler for Python, and it works > great. The package is now available via pip for anyone who needs it! > > On Thu, Jun 27, 2019 at 4:21 PM Yonatan Zunger wrote: >> >> Well, then. I think I'm going to have some fun with this. :) >> >>

[Python-Dev] Re: Announcing the new Python triage team on GitHub

2019-08-22 Thread Victor Stinner
Hi, Oh, I just wrote a similar email to python-committers, I didn't notice that Mariatta wrote to python-dev and python-committers. https://mail.python.org/archives/list/python-committ...@python.org/message/53K5MJAKLRGY2F34ZCYGL3WPWSJ4C5M2/ My worry is more about closing pull requests. Le 2

[Python-Dev] Re: PEP 601: discussion-to discuss.python.org

2019-09-04 Thread Victor Stinner
A litte bit more context. PEP 601: "Forbid return/break/continue breaking out of finally" https://www.python.org/dev/peps/pep-0601/ Abstract This PEP proposes to forbid return, break and continue statements within a finally suite where they would break out of the finally. Their use in such a loc

[Python-Dev] Buildbot failures

2019-09-13 Thread Victor Stinner
Hi, Many buildbot workers failed in the last 48 hours, it's likely related to higher activity caused by the core dev sprint currently running at London. Here are failures in random order. Can someone please have a look? I suggest to add comments to issues for collaboration. test__xxsubinterprete

[Python-Dev] (no subject)

2019-09-13 Thread Victor Stinner
Hi, FYI Yury Selivanov just proposed PEP 603 which is now discussed at: https://discuss.python.org/t/pep-603-adding-a-frozenmap-type-to-collections/2318 PEP-603: Adding a frozenmap type to collections https://www.python.org/dev/peps/pep-0603/ I don't have a strong preference between python-dev o

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread Victor Stinner
Le lun. 23 sept. 2019 à 21:36, Vinay Sajip via Python-Dev a écrit : > Nathaniel Smith wrote: > > Windows already has working symbol visibility handling, and PyAPI_FUNC is > > what controls it. So adding symbol visibility handling to Linux/macOS is > > just about making all the platforms consistent

[Python-Dev] Re: Adding GitHub usernames to the developer log

2019-09-25 Thread Victor Stinner
Le mer. 25 sept. 2019 à 08:24, Kyle Stanley a écrit : > Recently, Brett updated the developer log in the devguide > (https://devguide.python.org/developers/) to fetch the names of each core > developer and the date they were given commit privileges from the private > python-committers repository.

[Python-Dev] PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-09-27 Thread Victor Stinner
Hi, I dislike having to do that, but I had to make a last minute change in my PEP 587 "Python Initialization Configuration" to allow to modify the structure in the future without breaking the backward compatibility. I added a "struct_size" field to PyPreConfig and PyConfig: * https://bugs.python.

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-09-29 Thread Victor Stinner
Hi Nick, Le dim. 29 sept. 2019 à 08:47, Nick Coghlan a écrit : > I don't quite understand the purpose of this change, as there's no > stable ABI for applications embedding CPython. Well, I would like to prepare Python to provide a stable ABI for embedded Python. While it's not a design goal yet

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-09-29 Thread Victor Stinner
Le lun. 30 sept. 2019 à 00:33, Nick Coghlan a écrit : > As noted above, despite what I wrote on BPO, you no longer need to persuade > me that the version check is desirable, only that a narrow check on specific > struct sizes is preferable to a broad check on the expected API version. I underst

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-09-30 Thread Victor Stinner
Le lun. 30 sept. 2019 à 13:45, Nick Coghlan a écrit : > > I understand that your main motivation to use the Python version > > number rather than sizeof(PyConfig) is the error message. > > No, my main motivation is to create an API that can emit a useful > error message on *ALL* version conflicts

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-09-30 Thread Victor Stinner
Hi back, It seems like "config.struct_size = sizeof(PyConfig);" syntax is "not really liked". I don't see any traction to provide a stable ABI for embedded Python. The consensus is more towards: "it doesn't work and we don't want to bother with false promises" (nor add code for that). Since Luka

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-09-30 Thread Victor Stinner
Le lun. 30 sept. 2019 à 23:26, Antoine Pitrou a écrit : > I think if you wanted to make the PyConfig apt at providing > ABI-stability, you should have designed it differently. > `PyType_FromSpec` provides a useful model (pass an arbitrary-sized > static array of field initializers). PyConfig is e

[Python-Dev] Re: [python-committers] Re: Currently working on the release of Python 3.8.0rc1

2019-10-01 Thread Victor Stinner
Hi Łukasz, Le lun. 30 sept. 2019 à 16:32, Łukasz Langa a écrit : > > On 30 Sep 2019, at 16:09, Nick Coghlan wrote: > > > > I've filed https://bugs.python.org/issue38326 as a release blocker, as > > I don't think we should be cutting RCs when changes have been made to > > a PEP-approved API witho

[Python-Dev] Re: PEP 587 (Python Initialization Configuration) updated to be future proof again

2019-10-01 Thread Victor Stinner
o manually initialize these fields, except if you explicitly want to use these new fields to benefit of new configuration options. Victor Le mar. 1 oct. 2019 à 00:38, Nick Coghlan a écrit : > > > > On Tue., 1 Oct. 2019, 6:47 am Victor Stinner, wrote: >> >> Hi back, >> >&

[Python-Dev] Re: [python-committers] [RELEASED] Python 3.5.8rc2 is released

2019-10-14 Thread Victor Stinner
It seems like this security fix has not been merged into the 3.5 branch yet: "[3.5] bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441)" https://github.com/python/cpython/pull/16516 Please review it ;-) Victor Le sam. 12 oct. 2019 à 14:08, Larry Hastings a écrit : > > > On

[Python-Dev] Re: How official binaries are built?

2019-10-15 Thread Victor Stinner
Hi Inada-san, You can query the sysconfig module to check how Python has been built. Example: pyvstinner@apu$ python3 Python 3.7.4 (default, Jul 9 2019, 16:32:37) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sy

[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Victor Stinner
Hi Fabio, Right, the PyInterpreterState structure is now opaque. You need to include pycore_pystate.h which requires to define the Py_BUILD_CORE_MODULE macro. That's the internal C API which "should not be used", but it's ok to use it for very specific use cases, like debuggers. Maybe we should p

[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Victor Stinner
Would you mind to open an issue at bugs.python.org? You can put me ("vstinner") in the nosy list. Victor Le mer. 16 oct. 2019 à 17:07, Fabio Zadrozny a écrit : > > > On Wed, Oct 16, 2019 at 11:14 AM Victor Stinner wrote: >> >> Hi Fabio, >> >> Rig

[Python-Dev] Re: PEP for libffi + _ctypes

2019-10-17 Thread Victor Stinner
Hi, Our bundled copy of libffi has been removed from Python 3.7 by this change which should explain the rationale: https://bugs.python.org/issue27979 Not all Python changes need a PEP. For Windows builds, we provide prebuilt binaries of our dependencies: https://github.com/python/cpython-source-d

[Python-Dev] Should we allow IPv6 scope in urllib: http://[IPv6%scope]/path?

2019-10-21 Thread Victor Stinner
Hi, I wrote a PR to fix the following urllib security vulnerability: "urlparse of urllib returns wrong hostname" https://bugs.python.org/issue36338 https://github.com/python/cpython/pull/16780 While writing my fix, I found another issue about "[" and "]" characters in the user:password section o

[Python-Dev] Need help to fix test_asyncio issues

2019-10-21 Thread Victor Stinner
Hi, Right now, there are 14 open issues with "test_asyncio" in the title. Many test_asyncio tests have race conditions. I'm trying to fix them one by one, but it takes time, and then new tests are added with new race condition :-( For example, the following new test is failing randomly on Windows:

[Python-Dev] RFC: PEP 608: Coordinated Python release

2019-10-25 Thread Victor Stinner
Hi, I just posted a new PEP for comments, please reply there, rather than by email: https://discuss.python.org/t/rfc-pep-608-coordinated-python-release/2539 PEP 608: Coordinated Python release https://www.python.org/dev/peps/pep-0608/ Abstract: Block a Python release until a compatible version

[Python-Dev] Re: RFC: PEP 608: Coordinated Python release

2019-10-25 Thread Victor Stinner
I replied at https://discuss.python.org/t/rfc-pep-608-coordinated-python-release/2539/9 I would prefer to not split the discussion. I understood that discuss.python.org is now preferred to discuss PEPs. And I don't want to discuss here where PEPs should be discussed :-) Victor Le ven. 25 oct. 2

[Python-Dev] Re: Do not fallback to __trunc__ when convert to int

2019-11-04 Thread Victor Stinner
Le jeu. 31 oct. 2019 à 11:41, Serhiy Storchaka a écrit : > I propose to deprecate the falling back to __trunc__ for converting to > int and remove it in future. As Nick already said, I'm working on PEP 608 "Coordinated Python release" which discuss such change: https://www.python.org/dev/peps/pep

[Python-Dev] Re: Rejecting PEP 497

2019-11-07 Thread Victor Stinner
I wrote PEP 606 "Python Compatibility Version" which tries to address a similar problem, but with a different approach: https://www.python.org/dev/peps/pep-0606/ It mentions PEP 497 by the way ;-) It has been discussed at: https://mail.python.org/archives/list/python-id...@python.org/thread/SETZ6

[Python-Dev] Pass the Python thread state to internal C functions

2019-11-12 Thread Victor Stinner
Hi, Are you ok to modify internal C functions to pass explicitly tstate? -- I started to modify internal C functions to pass explicitly "tstate" when calling C functions: the Python thread state (PyThreadState). Example of C code (after my changes): if (_Py_EnterRecursiveCall(tstate, "

[Python-Dev] Re: Pass the Python thread state to internal C functions

2019-11-13 Thread Victor Stinner
Le mer. 13 nov. 2019 à 14:28, Larry Hastings a écrit : > I did exactly that in the Gilectomy prototype. Pulling it out of TLS was too > slow, What do you mean? Getting tstate from a TLS was a performance bottleneck by itself? Reading a TLS variable seems to be quite efficient. Mark Shannon wro

[Python-Dev] Re: Pass the Python thread state to internal C functions

2019-11-13 Thread Victor Stinner
Petr, Eric: sure, my question is only about the internal C functions. I have no plan to change the existing C API. Le mer. 13 nov. 2019 à 14:52, Eric V. Smith a écrit : > The last time we discussed this, there was pushback due to performance > concerns. I don't recall if that was actually measure

[Python-Dev] Re: Pass the Python thread state to internal C functions

2019-11-14 Thread Victor Stinner
Le jeu. 14 nov. 2019 à 04:55, Larry Hastings a écrit : > I'm pretty sure you understand the sentence "Pulling it out of TLS was too > slow". At the time CPython used the POSIX APIs for accessing thread local > storage, and I didn't know about and therefore did not try this "__thread" > GCC ext

[Python-Dev] Re: Pass the Python thread state to internal C functions

2019-11-18 Thread Victor Stinner
Le sam. 16 nov. 2019 à 20:55, Neil Schemenauer a écrit : > If you use threadstate often, > passing it explicitly (which likely uses a CPU register) could be a > win. If you use it rarely, that CPU register would be better > utilized for passing function arguments you actually use. Currently, I

[Python-Dev] Re: Exposing Tools/parser/unparse.py in the stdlib?

2019-11-19 Thread Victor Stinner
Hi, Le mar. 19 nov. 2019 à 01:42, Pablo Galindo Salgado a écrit : > What do people feel about exposing Tools/parser/unparse.py in the standard > library? I like the idea. I compared Lib/os.py to the unparse output and now I have many questions :-) (*) unparse loses all formatting and comments.

[Python-Dev] Re: Hold multiple tracebacks per-object in tracemalloc

2019-11-19 Thread Victor Stinner
Hi, Le mar. 19 nov. 2019 à 18:33, Sümer Cip a écrit : > First of all, I would like to thank for such a useful tool for debugging > memory issues. I am pretty proud as a Python lover that we have such a tool: > tracemalloc:) As the module author: you're welcome ;-) > AFAIU, tracemalloc holds

[Python-Dev] Re: Exposing Tools/parser/unparse.py in the stdlib?

2019-11-19 Thread Victor Stinner
Le mar. 19 nov. 2019 à 22:12, Pablo Galindo Salgado a écrit : > > Float infinity is replaced with 1e309. Again, maybe someone wants > to render this differently? It sounds like an arbitrary choice (which > "works" as expected). > > That is not true. float('inf') is rendered as float('inf´): > > >

[Python-Dev] Re: Stalemate on bringing back PEP 523 support into Python 3.8

2019-11-22 Thread Victor Stinner
I'm in favor of adding a public C API to get and set the frame evaluation function. API excluded from the limited API. I wrote https://github.com/python/cpython/pull/17340 to add such API to Python 3.8.1. For me, it's a Python 3.8.0 regression. Victor _

[Python-Dev] Re: Stalemate on bringing back PEP 523 support into Python 3.8

2019-11-22 Thread Victor Stinner
I modified "make install" to install internal header files, so it's possible to use the internal C API in debuggers and profilers. For example, to be able to inspect Python internals without having to call functions (which might modify the Python internal state). I made this change to be able to mo

[Python-Dev] Re: 3.10 or 4.0?

2019-11-28 Thread Victor Stinner
It has been discussed a few months ago. There is the "if six.PY3: ..." issue and similar issues which should be solved first. Basic example: $ python3 Python 3.7.5 (default, Oct 17 2019, 12:16:48) >>> import sys >>> sys.version_info = (4,0) >>> import six Traceback (most recent call last): File

[Python-Dev] Re: HighwayHash > SipHash?

2019-12-03 Thread Victor Stinner
Hi, Le lun. 2 déc. 2019 à 08:18, Larry Hastings a écrit : > My random Googling turned up a new hash function tonight: "HighwayHash". > It's a keyed hash function like the SipHash we now use for hashing strings / > bytes / etc for our lovely dicts. > > Key points: > > Apache 2 license > Can use

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
Le mer. 4 déc. 2019 à 06:41, Inada Naoki a écrit : > Currently, u-prefix is very widely used. It shouldn't be removed anytime > soon. > And I agree that we shouldn't raise DeprecationWarning for now. > > But how about 5, 10, and 20 years later? No one knows it. > Let's stop discussing it. It c

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
You may want to have a look at the deferred PEP 501 -- General purpose string interpolation: https://www.python.org/dev/peps/pep-0501/ It was proposed while PEP 498 -- Literal String Interpolation (f-string) was being discussed, which was accepted: https://www.python.org/dev/peps/pep-0498/ PEP 50

[Python-Dev] Re: Multiple reference leaks in master

2019-12-04 Thread Victor Stinner
Le mer. 4 déc. 2019 à 01:45, Charalampos Stratakis a écrit : > Also noting here that the reference leaks builds are triggered once a day so > many times it's not possible to find the commit that triggered a leak through > the web ui of buildbot. In this case it's good to also check the previous

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
INADA-san: > We need to avoid major breakage. > But we accept small breakages on every minor release. > And u-prefix is major for now. IMHO we need a metric to measure the risk of an incompatible change: estimate the percentage of broken Python applications. For example, run the test suite of the

[Python-Dev] Re: Macros instead of inline functions?

2019-12-04 Thread Victor Stinner
Hi, I'm working on cleaning up the C API, long rationale: https://pythoncapi.readthedocs.io/ Macros are causing multiple issues: * They often leak "implementation details" and so are incompatible with a stable ABI * They have multiple pitfalls: https://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.h

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
Le mer. 4 déc. 2019 à 14:49, Thomas Wouters a écrit : >> (...) >> It's very different if an incompatible change break 1% or 90% of >> Python projects. > > Unfortunately there is a distinctive bias if you select popular projects, or > even packages from PyPI. There is a very large body of work tha

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Victor Stinner
Please try to get an email client which is able to reply in a thread, rather than creating a new thread each time you send an email. You might want to try HyperKitty: https://mail.python.org/archives/list/python-dev@python.org/ Victor Le jeu. 5 déc. 2019 à 10:50, Anders Munch a écrit : > > >> I

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Victor Stinner
Le jeu. 5 déc. 2019 à 12:14, Thomas Wouters a écrit : > It should, but it doesn't always :) If you forget how your data is flawed, > the 'smarter' decision can easily be wrong, instead. I do think it's a good > idea to reject ideas that would break a certain number of PyPI packages, say, > but

[Python-Dev] Re: Rejecting PEP 606 and 608

2019-12-06 Thread Victor Stinner
to work on the CI idea to provide a feedback on broken projects. > We want to thank Victor Stinner and Miro Hrončok for their contributions and > authorship of these PEPs. You're welcome ;-) Victor -- Night gathers, and now my watch begins. It shall not end until my death. __

[Python-Dev] Re: Travis CI for backports not working.

2019-12-06 Thread Victor Stinner
Hello, Le mar. 26 nov. 2019 à 20:40, Brett Cannon a écrit : > I have turned Travis off as a required check on the 3.7, 3.8, and master > branches until someone is able to get a fix in. That makes me sad :-( Is there an issue at bugs.python.org to track it? What's the status? Right now, I see Tr

<    16   17   18   19   20   21   22   23   24   25   >