[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread micro codery
> There was a discussion a while back ( a year or so?? ) on Python-ideas > that introduced the idea of having more "sentinel-like" singletons in > Python -- right now, we only have None. > Not quite true, we also have Ellipsis, which already has a nice repr that both reads easily and still

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread David Mertz
On Thu, May 13, 2021 at 10:31 PM Christopher Barker wrote: > There was a discussion a while back ( a year or so?? ) on Python-ideas > that introduced the idea of having more "sentinel-like" singletons in > Python -- right now, we only have None. > As I remember, the year-ago conversation was

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Christopher Barker
There was a discussion a while back ( a year or so?? ) on Python-ideas that introduced the idea of having more "sentinel-like" singletons in Python -- right now, we only have None. I can't remember the context, but the consensus seemed to be that it was easy to create a custom sentinel object,

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Steven D'Aprano
On Thu, May 13, 2021 at 08:44:04AM -0700, Christopher Barker wrote: > I suggest we keep it really simple, and name the implementation. > > Building on Steve Holden’s suggestion: > > There is broad interest in improving the performance of the cPython > runtime. (Interpreter?) +1 As excellent as

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Steven D'Aprano
On Thu, May 13, 2021 at 03:20:31AM -0400, Terry Reedy wrote: > What is the purpose of this PEP? It seems in part to be like a > Standards Track PEP in that it proposes a new (revised) implementation > idea for the CPython bycode interpreter. Do you not intend this to not > constitute

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Stephen J. Turnbull
Mark Shannon writes: > On 13/05/2021 5:32 am, Terry Reedy wrote: > > The claim that starts the Motivation section, "Python is widely > > acknowledged as slow.", has multiple problems. > How would you rephrase it, bearing in mind that needs to be short? We can make CPython run

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Tal Einat
On Thu, May 13, 2021 at 8:46 PM Eric V. Smith wrote: > > > On 5/13/2021 1:39 PM, Tal Einat wrote: > > Here is my suggestion (also posted on the related bpo-44123), which is > > also simple, ensures a single instance is used, even considering > > multi-threading and pickling, and has a better

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Larry Hastings
On 5/13/21 10:46 AM, Eric V. Smith wrote: >>> MISSING I think a repr of just "MISSING", or maybe "dataclasses.MISSING" would be better. I literally just went down this road--for a while there was a special sentinel value for the eval_str parameter to inspect.get_annotations().  The repr

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Mats Wichmann
On 5/12/21 4:10 PM, Terry Reedy wrote: On 5/12/2021 5:14 PM, Antoine Pitrou wrote: On Wed, 12 May 2021 17:05:03 -0400 Terry Reedy wrote: Yet you always see it: new people not knowing where to start, highly skilled contributors drowning and intermediate contributors moving slowly I have

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Fabio Zadrozny
Em qua., 12 de mai. de 2021 às 14:45, Mark Shannon escreveu: > Hi everyone, > > I would like to present PEP 659. > > This is an informational PEP about a key part of our plan to improve > CPython performance for 3.11 and beyond. > > For those of you aware of the recent releases of Cinder and

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Stephen J. Turnbull
Abdur-Rahmaan Janhangeer writes: > No i mean fake path in the sense of a fork > of CPython with issues for learning purposes *Creating* plausible issues is hard work, I assure you as a university professor. Coming up with "exercises" that are not makework requires expertise in both the domain

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 1:39 PM, Tal Einat wrote: On Thu, May 13, 2021 at 7:44 PM Ethan Furman wrote: Consider me complaining. ;-) +1 An actual Sentinel class would be helpful: >>> class Sentinel: ... def __init__(self, repr): ... self.repr = repr ... def

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 12:41 PM, Ethan Furman wrote: On 5/13/21 2:15 AM, Irit Katriel via Python-Dev wrote: >>> help(traceback.print_exception) Help on function print_exception in module traceback: print_exception(exc, /, value=0x02825DF09650>, tb= at

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Tal Einat
On Thu, May 13, 2021 at 7:44 PM Ethan Furman wrote: > > Consider me complaining. ;-) +1 > An actual Sentinel class would be helpful: > > >>> class Sentinel: > ... def __init__(self, repr): > ... self.repr = repr > ... def __repr__(self): > ...

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Guido van Rossum
Have you heard of this book? It's an excellent companion to the source code. https://realpython.com/products/cpython-internals-book/ On Thu, May 13, 2021 at 12:30 AM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Greetings, > > One crucial missing piece in the Python world is the

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Ethan Furman
On 5/13/21 2:15 AM, Irit Katriel via Python-Dev wrote: > > >>> help(traceback.print_exception) > Help on function print_exception in module traceback: > > print_exception(exc, /, value=, tb= at 0x02825DF09650>, limit=None, file=None, chain=True) On

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Christopher Barker
I suggest we keep it really simple, and name the implementation. Building on Steve Holden’s suggestion: There is broad interest in improving the performance of the cPython runtime. (Interpreter?) -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Stéfane Fermigier
On Thu, May 13, 2021 at 8:42 AM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Actual quote by "a Python Software Foundation fellow and contrib- > utor to Python infrastructure projects" > Ah, this is what you were referring to. The document was published 5 years ago, so this may or

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Stéfane Fermigier
On Wed, May 12, 2021 at 8:51 PM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Great news, just a tiny bit from me. > I read the other day in the OpenSource report > sponsored by the Ford Foundation a CPython > contributor stating that we have an all time high > count of Python users

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Antoine Pitrou
On Thu, 13 May 2021 13:44:54 +0100 Steve Dower wrote: > On 13May2021 1248, Petr Viktorin wrote: > > On 13. 05. 21 11:45, Antoine Pitrou wrote: > >> > >> Le 13/05/2021 à 11:40, Irit Katriel a écrit : > >>> > >>> > >>> On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou >>>

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 10:02 AM, Tal Einat wrote: On Thu, May 13, 2021 at 4:31 PM Eric V. Smith wrote: I do think a python-wide standard for this would be helpful, but I don't see how to change existing code given backward compatibility constraints. While we're on the subject, these sentinels also

[Python-Dev] Re: Future PEP: Include Fine Grained Error Locations in Tracebacks

2021-05-13 Thread Barry
> On 13 May 2021, at 02:09, Mike Miller wrote: > >  >> On 2021-05-11 16:12, Guido van Rossum wrote: >> On Tue, May 11, 2021 at 4:07 PM Gregory P. Smith > There's a difference between tracebacks dumped as plain text (utf-8) by >>traceback.print_exc() appearing on stderr or directed into

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Tal Einat
On Thu, May 13, 2021 at 4:31 PM Eric V. Smith wrote: > > I do think a python-wide standard for this would be helpful, but I don't > see how to change existing code given backward compatibility constraints. While we're on the subject, these sentinels also don't compare properly using `is` after

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 7:48 AM, Petr Viktorin wrote: On 13. 05. 21 11:45, Antoine Pitrou wrote: Le 13/05/2021 à 11:40, Irit Katriel a écrit : On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou > wrote:  I agree that is a reasonable spelling. I initially suggested ,

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Steve Dower
On 13May2021 1248, Petr Viktorin wrote: On 13. 05. 21 11:45, Antoine Pitrou wrote: Le 13/05/2021 à 11:40, Irit Katriel a écrit : On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou > wrote:  I agree that is a reasonable spelling. I initially suggested , but

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Steven D'Aprano
On Thu, May 13, 2021 at 09:18:27AM +0100, Mark Shannon wrote: > Since, faster == less energy for the same amount of work, making CPython > faster will reduce the amount of CO2 produced to do that work and > hopefully make it less of a concern. Work expands to fill the time available: if Python

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Petr Viktorin
On 13. 05. 21 11:45, Antoine Pitrou wrote: Le 13/05/2021 à 11:40, Irit Katriel a écrit : On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou > wrote:  I agree that is a reasonable spelling. I initially suggested , but now I'm not sure because it doesn't

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Steve Holden
On Thu, May 13, 2021 at 9:18 AM Mark Shannon wrote: > Hi Terry, > > On 13/05/2021 5:32 am, Terry Reedy wrote: > > On 5/12/2021 1:40 PM, Mark Shannon wrote: > > > >> This is an informational PEP about a key part of our plan to improve > >> CPython performance for 3.11 and beyond. > > > >> As

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Antoine Pitrou
Le 13/05/2021 à 11:40, Irit Katriel a écrit : On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou > wrote:  I agree that is a reasonable spelling. I initially suggested , but now I'm not sure because it doesn't indicate what happens when you don't provide it

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Irit Katriel via Python-Dev
On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou wrote: > > I agree that is a reasonable spelling. > > I initially suggested , but now I'm not sure because it doesn't indicate what happens when you don't provide it (as in, what is the default value). So now I'm with or . The arg is only

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Antoine Pitrou
On Thu, 13 May 2021 10:15:03 +0100 Irit Katriel via Python-Dev wrote: > Following a recent change, we now have in traceback.py: > > _sentinel = object() > def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, > file=None, chain=True): > > So now: > > >>> import

[Python-Dev] The repr of a sentinel

2021-05-13 Thread Irit Katriel via Python-Dev
Following a recent change, we now have in traceback.py: _sentinel = object() def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None, file=None, chain=True): So now: >>> import traceback >>> help(traceback.print_exception) Help on function print_exception in

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Chris Jerdonek
On Wed, May 12, 2021 at 10:48 AM Mark Shannon wrote: > ... > For those of you aware of the recent releases of Cinder and Pyston, > PEP 659 might look similar. > It is similar, but I believe PEP 659 offers better interpreter > performance and is more suitable to a collaborative, open-source >

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Mark Shannon
Hi Terry, On 13/05/2021 8:20 am, Terry Reedy wrote: On 5/12/2021 1:40 PM, Mark Shannon wrote: This is an informational PEP about a key part of our plan to improve CPython performance for 3.11 and beyond. What is the purpose of this PEP?  It seems in part to be like a Standards Track PEP in

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Paul Moore
On Thu, 13 May 2021 at 09:23, Mark Shannon wrote: > > Hi Terry, > > On 13/05/2021 5:32 am, Terry Reedy wrote: > > On 5/12/2021 1:40 PM, Mark Shannon wrote: > > > >> This is an informational PEP about a key part of our plan to improve > >> CPython performance for 3.11 and beyond. > > > >> As

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Mark Shannon
Hi Terry, On 13/05/2021 5:32 am, Terry Reedy wrote: On 5/12/2021 1:40 PM, Mark Shannon wrote: This is an informational PEP about a key part of our plan to improve CPython performance for 3.11 and beyond. As always, comments and suggestions are welcome. The claim that starts the

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Abdur-Rahmaan Janhangeer
Greetings, On Thu, May 13, 2021 at 11:43 AM Chris Angelico wrote: > How is this "educational version" different from a forked git > repository? I'm confused here. > Oh i mean a forked git repository with internal-focused documentations, issues opened with description of changes to be made then

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Chris Angelico
On Thu, May 13, 2021 at 5:37 PM Abdur-Rahmaan Janhangeer wrote: > > Greetings, > > One crucial missing piece in the Python world is the focus > on internals of projects. You have many talks on usage and > scaling but not enough on internals. Even less workshops. > For OpenSource to thrive, you

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Abdur-Rahmaan Janhangeer
Greetings, One crucial missing piece in the Python world is the focus on internals of projects. You have many talks on usage and scaling but not enough on internals. Even less workshops. For OpenSource to thrive, you need people who master the codebase. It's a long process. You get there by

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Terry Reedy
On 5/12/2021 1:40 PM, Mark Shannon wrote: This is an informational PEP about a key part of our plan to improve CPython performance for 3.11 and beyond. What is the purpose of this PEP? It seems in part to be like a Standards Track PEP in that it proposes a new (revised) implementation idea

[Python-Dev] Re: Speeding up CPython

2021-05-13 Thread Abdur-Rahmaan Janhangeer
Actual quote by "a Python Software Foundation fellow and contrib- utor to Python infrastructure projects" What frustrates me most is that we have an all-time high of Python developers and an all-time low on high quality contri- butions.[...] As soon as pivotal developers like Armin Ronacher slow