[Python-Dev] Re: Starting a new thread

2022-05-10 Thread Gregory P. Smith
On Tue, May 10, 2022 at 10:34 AM Barney Stratford < barney_stratf...@fastmail.fm> wrote: > > 1. Does t = target(...) start the thread? I think it does. > I think it does too. In the commonest use case, immediately after creating > a thread, you start it. And if you want to delay the thread but sti

[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: Migration plan for the distutils removal in Python 3.12

2022-05-10 Thread Steve Dower
On 5/10/2022 9:38 PM, Christopher Barker wrote: So if you can't entirely drop distutils in the stdlib, I don't think we can count on the rest of the community being able to drop it as well. The only reason distutils is used to build Python is for self-bootstrapping. setuptools would have to av

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

2022-05-10 Thread Steve Dower
If we're not shipping it, we should just move it out of the way. Otherwise, there are a few places in the various Windows packages that will need it to be explicitly excluded. We should already have similar exclusions for the test suite and a few other modules, but they're a bit scattered arou

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

2022-05-10 Thread Christopher Barker
Just a note: The huge amount of work/progress that has gone into modernizing the building/packaging tools is great, but to be honest, C extensions have been somewhat neglected. e.g. I still need to use old fashioned setup.py to build some of my projects (C and Cython extensions) This may not be r

[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 Brett Cannon
On Tue, May 10, 2022 at 10:23 AM Guido van Rossum wrote: > Shouldn't we wean our internal tools off this obsolete version of > distutils too, rather than just move it around? > I think so. We technically have a year to get this done, so if we can't do that then I'm afraid we have much bigger iss

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

2022-05-10 Thread Brett Cannon
On Tue, May 10, 2022 at 12:59 AM Victor Stinner wrote: > 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 rem

[Python-Dev] Re: Starting a new thread

2022-05-10 Thread Barney Stratford
> 1. Does t = target(...) start the thread? I think it does. I think it does too. In the commonest use case, immediately after creating a thread, you start it. And if you want to delay the thread but still use the decorator, then you can do that explicitly with some locks. In fact, it’s probably

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

2022-05-10 Thread Guido van Rossum
Shouldn't we wean our internal tools off this obsolete version of distutils too, rather than just move it around? On Tue, May 10, 2022 at 9:26 AM Steve Dower wrote: > On 5/10/2022 4:33 PM, Christian Heimes wrote: > > On 10/05/2022 13.18, Victor Stinner wrote: > >> test_peg_generator and test_cpp

[Python-Dev] Re: Starting a new thread

2022-05-10 Thread Joao S. O. Bueno
On Tue, May 10, 2022 at 1:20 PM Paul Moore wrote: > On Tue, 10 May 2022 at 16:31, Barney Stratford > wrote: > > > > Hello all. > > > > It occurs to me that creating threads in Python is more awkward than it > needs to be. Every time I want to start a new thread, I end up writing the > same thing

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

2022-05-10 Thread Steve Dower
On 5/10/2022 4:33 PM, Christian Heimes wrote: On 10/05/2022 13.18, Victor Stinner wrote: test_peg_generator and test_cppext build C extensions with distutils. Until these tests are modified to use something else, we still need to keep distutils. So I propose to rename it to _distutils to remove

[Python-Dev] Re: Python grammar test cases

2022-05-10 Thread Pablo Galindo Salgado
That's used as a literal '/' to make positional-only arguments work. For example: lambda x, y, /, z: x+y+z On Tue, 10 May 2022 at 17:11, Venkat Ramakrishnan < venkat.archit...@gmail.com> wrote: > I am looking at: > https://docs.python.org/3/reference/grammar.html > > in which the following defin

[Python-Dev] Re: Starting a new thread

2022-05-10 Thread Paul Moore
On Tue, 10 May 2022 at 16:31, Barney Stratford wrote: > > Hello all. > > It occurs to me that creating threads in Python is more awkward than it needs > to be. Every time I want to start a new thread, I end up writing the same > thing over and over again: > > def target(*args, **kwds): > ...

[Python-Dev] Re: Python grammar test cases

2022-05-10 Thread Jelle Zijlstra
El mar, 10 may 2022 a las 9:06, Venkat Ramakrishnan (< venkat.archit...@gmail.com>) escribió: > I am looking at: > https://docs.python.org/3/reference/grammar.html > > in which the following definition is found: > > lambda_slash_no_default: > | lambda_param_no_default+ '/' ',' > | lambda_p

[Python-Dev] Re: Python grammar test cases

2022-05-10 Thread Venkat Ramakrishnan
I am looking at: https://docs.python.org/3/reference/grammar.html in which the following definition is found: lambda_slash_no_default: | lambda_param_no_default+ '/' ',' | lambda_param_no_default+ '/' &':' Can someone tell me how '/' is being used here in the syntax? Thanks, Venkat. _

[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 Jeremy Kloth
On Tue, May 10, 2022 at 9:34 AM Christian Heimes wrote: > We can easily take care of test_cppext and add the build step to > Makefile. How does test_peg_generator depend on distutils? I don't see > an import of distutils in the directory. You need to look at the files in the Tools directory. Tha

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

2022-05-10 Thread Christian Heimes
On 10/05/2022 13.18, Victor Stinner wrote: 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/

[Python-Dev] Starting a new thread

2022-05-10 Thread Barney Stratford
Hello all. It occurs to me that creating threads in Python is more awkward than it needs to be. Every time I want to start a new thread, I end up writing the same thing over and over again: def target(*args, **kwds): ... t = threading.Thread(target = target, args = , kwargs= ) t.start() Th

[Python-Dev] Re: Python grammar test cases

2022-05-10 Thread Pablo Galindo Salgado
Could you share with us some of the context of what are you trying to achieve? That way we can offer more specialized help :) On Tue, 10 May 2022 at 15:50, Venkat Ramakrishnan < venkat.archit...@gmail.com> wrote: > Presuming I am looking at the right link?: > https://github.com/python/cpython/tre

[Python-Dev] Re: Python grammar test cases

2022-05-10 Thread Venkat Ramakrishnan
Presuming I am looking at the right link?: https://github.com/python/cpython/tree/main/Lib/test I am currently focusing on Lambda function. I have a few test cases written. I have some questions too. Would be great if I could talk/chat to someone about these questions. Thanks. ___

[Python-Dev] Re: Python grammar test cases

2022-05-10 Thread Pablo Galindo Salgado
In addition, test_exceptions test a bunch of syntax errors and related locations. On Tue, 10 May 2022 at 06:41, Serhiy Storchaka wrote: > 10.05.22 08:10, Venkat Ramakrishnan пише: > > I'm wondering if there's a repository of test cases that > > test the Python grammar. Any help would be apprecia

[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 Christian Heimes
On 10/05/2022 09.53, Victor Stinner wrote: 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

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

2022-05-10 Thread Michał Górny
On Tue, 2022-05-10 at 09:53 +0200, Victor Stinner wrote: > 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 r

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

2022-05-10 Thread Christian Heimes
On 10/05/2022 09.53, Victor Stinner wrote: 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

[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? *