[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Stephen J. Turnbull
Executive summary: This thread is about a "seven blind men and an elephant" problem. Jim J. Jewett writes: > I think his point is that most of his students (economics or > business, rather than comp sci) will never need to use Perl or C or > Java. Python is friendly enough to be useful, but t

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Stephen J. Turnbull
Steven D'Aprano writes: > On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > > That's what I would mean by basic sys-admin skills. And *surprise!* > > my students don't have them, and don't need them ... until they start > > using Python. > > Is it *only* Python though?

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Steven D'Aprano
On Sat, Feb 27, 2021 at 01:04:08AM +, Oscar Benjamin wrote: > On Fri, 26 Feb 2021 at 23:06, Jim J. Jewett wrote: > > > > I think his point is that most of his students (economics or > > business, rather than comp sci) will never need to use Perl or C or > > Java. Python is friendly enough

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Jim J. Jewett
> Why would you want a different flavor of ExceptionGroup? The easiest example you took care of by saving the exceptions in a list instead of a set. Next would be the ExceptionGroup vs BaseExceptionGroup that I *don't* like, but someone might. There are also libraries that promise to raise on

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Jim J. Jewett
ValueError("Partner: 3 File: 127 record: 93 is missing field: currency") tells the production support people who to contact and what to say. I'm not sure what additional context would be helpful, let alone how it might have been available "at the time", but lost now that the ValueAttribute is

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Irit Katriel via Python-Dev
On Sat, Feb 27, 2021 at 12:35 AM Greg Ewing wrote: > While I don't particularly mind if we get ExceptionGroup, giving > it special magical semantics, and especially new syntax, seems like > bringing a massively overpowered weapon to bear on something that > will only be used rarely. > > Handling

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Oscar Benjamin
On Fri, 26 Feb 2021 at 23:06, Jim J. Jewett wrote: > > I think his point is that most of his students (economics or business, rather > than comp sci) will never need to use Perl or C or Java. Python is friendly > enough to be useful, but this is still a major pain point. Thanks Jim, that is th

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Irit Katriel via Python-Dev
On Fri, Feb 26, 2021 at 11:43 PM Guido van Rossum wrote: > On Fri, Feb 26, 2021 at 3:18 PM Marco Sulla > wrote: > >> Excuse me if I post here. Maybe is a stupid question: why, instead of >> introducing except*, Python can't extend the functionality of except, >> so it can do what except* would d

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Irit Katriel via Python-Dev
On Sat, Feb 27, 2021 at 12:47 AM Jim J. Jewett wrote: > > > Is this not allowed? > > >try: > >try: > >obj.func()# function that raises ExceptionGroups > >except AttributeError: > >logger.info("obj doesn't have a func") > >except *(AttributeError, SyntaxError): > >l

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Jim J. Jewett
> Thank you for turning to what happens with 'except ValueError' when an > ExceptionGroup[ValueError] is raised, this is important. > I'm not sure it's safe to assume that it is necessarily a > programming >error, and that the interpreter can essentially break the program in this > case. I'm bett

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Greg Ewing
While I don't particularly mind if we get ExceptionGroup, giving it special magical semantics, and especially new syntax, seems like bringing a massively overpowered weapon to bear on something that will only be used rarely. Handling multiple exceptions from an ExceptionGroup could be done using

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Jim J. Jewett
You still need except* for the (unusual?) case where the ExceptionGroup contains multiple individual Exceptions, and you want them all to be processed. (This possibility is the justification for the PEP, but the difficulty of associating an exception with the specific task that raised it sugges

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Jim J. Jewett
FWIW, the only situation I can think of where you would care that the enclosed exception instances are BaseException but not regular Exception is interactive debugging, and even then there are enough other ways to kill the whole process that I think most people would use one of them instead of w

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Guido van Rossum
On Fri, Feb 26, 2021 at 3:18 PM Marco Sulla wrote: > Excuse me if I post here. Maybe is a stupid question: why, instead of > introducing except*, Python can't extend the functionality of except, > so it can do what except* would do? > Good question. Here's an example: ``` try: . . . except O

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Jim J. Jewett
> We keep the ability to wrap any exception, while we lose the "fail-fast if > you forget to handle an ExceptionGroup" feature, which was intended as a > kindness towards those who abuse "except Exception". How is this a kindness? Whenever I've used except Exception or stronger, it was a sanitary

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Guido van Rossum
On Thu, Feb 25, 2021 at 9:40 PM Nathaniel Smith wrote: > [...] > Yury/I/others did discuss the idea of a > BaseExceptionGroup/ExceptionGroup split a lot, and I think the general > feeling is that it could potentially work, but feels like a > complicated and awkward hack, so no-one was super excit

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Marco Sulla
Excuse me if I post here. Maybe is a stupid question: why, instead of introducing except*, Python can't extend the functionality of except, so it can do what except* would do? ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an ema

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Jim J. Jewett
I think his point is that most of his students (economics or business, rather than comp sci) will never need to use Perl or C or Java. Python is friendly enough to be useful, but this is still a major pain point. The problem is made worse because it often hits at the beginning instead of 7 l

[Python-Dev] Re: Which thing is "Development Mode"

2021-02-26 Thread Steven D'Aprano
Hi Coyot, and welcome! Can you explain the circumstances where a developer, or an end user, might be confused as to which development mode is meant? "Dev mode" is a very common term: Windows 10 has a development mode. So does the X-Box and the Samsung Galaxy phone. Ruby on Rails also has a dev

[Python-Dev] Re: Which thing is "Development Mode"

2021-02-26 Thread Paul Bryan
Perhaps refine the packaging nomenclature to be "local development mode"? On Fri, 2021-02-26 at 18:34 +, Coyot Linden wrote: > As of 3.7, there is now a python feature called Development Mode: > > https://docs.python.org/3/library/devmode.html#devmode > > Which has a confusingly similar and

[Python-Dev] Re: Which thing is "Development Mode"

2021-02-26 Thread Victor Stinner
I suggest to assign a color to each development mode to distinguish them. Victor On Fri, Feb 26, 2021 at 7:50 PM Coyot Linden wrote: > > As of 3.7, there is now a python feature called Development Mode: > > https://docs.python.org/3/library/devmode.html#devmode > > Which has a confusingly simila

[Python-Dev] Re: Which thing is "Development Mode"

2021-02-26 Thread Cameron Simpson
On 26Feb2021 18:34, Coyot Linden wrote: >As of 3.7, there is now a python feature called Development Mode: > >https://docs.python.org/3/library/devmode.html#devmode > >Which has a confusingly similar and nearly identical name to a setuptools >feature: > >https://packaging.python.org/guides/distri

[Python-Dev] Re: Moving threadstate to thread-local storage.

2021-02-26 Thread Victor Stinner
Sure. The plan is to use __thread when possible ;-) Victor On Thu, Feb 25, 2021 at 4:58 AM 谢俊逸 via Python-Dev wrote: > > On MacOS & iOS, __thread variable is 35% faster than using > pthread_getspecific. > > getSpecific cost: 0.000649 > getTLS cost: 0.000423 > > > - (void)test { double t1 = CFAb

[Python-Dev] Which thing is "Development Mode"

2021-02-26 Thread Coyot Linden
As of 3.7, there is now a python feature called Development Mode: https://docs.python.org/3/library/devmode.html#devmode Which has a confusingly similar and nearly identical name to a setuptools feature: https://packaging.python.org/guides/distributing-packages-using-setuptools/#working-in-deve

[Python-Dev] Summary of Python tracker Issues

2021-02-26 Thread Python tracker
ACTIVITY SUMMARY (2021-02-19 - 2021-02-26) 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: open7430 ( +2) closed 47636 (+58) total 55066 (+60) Open issues w

[Python-Dev] Re: PEP 637 - Support for indexing with keyword arguments: request for feedback for SC submission

2021-02-26 Thread Stefano Borini
If interested, you can try it out from my github branch: https://github.com/stefanoborini/cpython/tree/PEP-637-implementation-attempt-2 I am going to sync it against python master in a few minutes (it's been a while, there probably will be conflicts). Please break it. On Thu, 25 Feb 2021 at 16:

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Irit Katriel via Python-Dev
On Fri, Feb 26, 2021 at 2:42 PM Nathaniel Smith wrote: > On Fri, Feb 26, 2021 at 5:05 AM Irit Katriel > wrote: > > I'm not sure it's safe to assume that it is necessarily a programming > error, and that the interpreter can essentially break the program in this > case. > > Is this not allowed? >

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Emily Bowman
A side benefit is that if an Exception somehow propagates up where only ExceptionGroup is defined, except *() could just work anyway, though it might take a little magic to make sure they act the same. Like Guido said, I don't think it can be retrofitted into existing *-less APIs, and it'll either

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Nathaniel Smith
On Fri, Feb 26, 2021 at 5:05 AM Irit Katriel wrote: > I'm not sure it's safe to assume that it is necessarily a programming error, > and that the interpreter can essentially break the program in this case. > Is this not allowed? > > try: > try: > obj.func()# function that raises E

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Paul Moore
On Fri, 26 Feb 2021 at 13:31, Oscar Benjamin wrote: > Where Python is awkward is at the point where you actually *want* to > teach students to use the command line. The problem is that Python is > not set up for command line use out of the box in a consistent way > across different platforms. My

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Oscar Benjamin
On Fri, 26 Feb 2021 at 09:07, Steven D'Aprano wrote: > > On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > > Mike Miller writes: > > > > > "sys-admin" is a bit of an overstatement in my phrasing. The core > > > is that you need to understand how a PATH works and be able to

[Python-Dev] Re: PEP 654 -- Exception Groups and except* : request for feedback for SC submission

2021-02-26 Thread Irit Katriel via Python-Dev
FTR: nobody on this long thread so far has suggested that there are no valid use cases for `except Exception`. Thank you for turning to what happens with 'except ValueError' when an ExceptionGroup[ValueError] is raised, this is important. I'm not sure it's safe to assume that it is necessarily a

[Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-26 Thread Steven D'Aprano
On Fri, Feb 26, 2021 at 11:41:56AM +0900, Stephen J. Turnbull wrote: > Mike Miller writes: > > > "sys-admin" is a bit of an overstatement in my phrasing. The core > > is that you need to understand how a PATH works and be able to run > > pip and cd into folders and perhaps run rm/del, etc. Ba