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

2021-06-01 Thread Tal Einat
On Tue, May 25, 2021 at 10:09 PM Eric Nieuwland wrote: > > > To add to the suggestions already given in this thread I dug into code I > wrote some time ago. Offered as an inspiration. > > === missing.py === > > from typing import Any > > def MISSING(klass: Any) -> Any: """ create a sentinel to

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

2021-06-01 Thread Tal Einat
On Tue, May 25, 2021 at 11:25 AM Pascal Chambon wrote: > > Hello, and thanks for the PEP, > > I feel like the 3-lines declaration of a new sentinel would discourage a > bit its adoption compared to just "sentinel = object()" I now tend to agree. The new version of the draft PEP proposes a

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

2021-06-01 Thread Tal Einat
Thanks for this, Luciano! My main issue with using class objects is that such use of them would be unusual and potentially confusing. I think that is important in general, and doubly so for something I suggest adding to the stdlib. Additionally, I very much would like for each sentinel object to

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

2021-06-01 Thread Tal Einat
Following the continued discussion, I'm currently in favor of a simple interface using a factory function, i.e. NotGiven = sentinel('NotGiven'). I've created a new GitHub repo with a reference implementation. It also includes a second version of the draft PEP, addresses some of the additional

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

2021-05-25 Thread Eric Nieuwland
To add to the suggestions already given in this thread I dug into code I wrote some time ago. Offered as an inspiration. === missing.py === from typing import Any def MISSING(klass: Any) -> Any: """ create a sentinel to indicate a missing instance of a class :param klass: the

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

2021-05-25 Thread Luciano Ramalho
On Tue, May 25, 2021 at 1:08 PM Pascal Chambon wrote: > I feel like the 3-lines declaration of a new sentinel would discourage a > bit its adoption compared to just "sentinel = object()" How about one line? class Missing(Sentinel): pass And avoiding a lot of complications?

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

2021-05-25 Thread Pascal Chambon
Hello, and thanks for the PEP, I feel like the 3-lines declaration of a new sentinel would discourage a bit its adoption compared to just "sentinel = object()" From what I understand from the PEP, if new classes are defined inside the closure of a factory function, some Python implementations

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

2021-05-24 Thread Luciano Ramalho
On Mon, May 24, 2021 at 11:44 AM Tal Einat wrote: > > But frankly Luciano's idea of a base class that can be subclassed seems the > > most startightford to me. > > Yes, and it's what I originally suggested near the beginning of this thread :) I am sorry to have missed your previous e-mail with

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

2021-05-24 Thread Tal Einat
On Mon, May 24, 2021 at 6:04 AM Christopher Barker wrote: > > 1) “Add a single new sentinel value, e.g. MISSING or Sentinel” (under > rejected) > > I was one of the proponent of that -- but not as an alternative to having a > stadardars way to create unique sentinels, but as an addition. That's

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

2021-05-24 Thread Tal Einat
On Mon, May 24, 2021 at 4:10 AM MRAB wrote: > > On 2021-05-24 01:37, Luciano Ramalho wrote: > > Now I can use NotGiven as the sentinel, and its default repr is . > > > The repr of other singletons are the names of those singletons, eg. > "None", so why "" instead of "NotGiven"? Yea, that's up in

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

2021-05-24 Thread Tal Einat
On Mon, May 24, 2021 at 3:30 AM Luciano Ramalho wrote: > > On Sun, May 23, 2021 at 3:37 AM Tal Einat wrote: > > I put up an early draft of a PEP on a branch in the PEPs repo: > > https://github.com/python/peps/blob/sentinels/pep-.rst > > Thanks for that PEP, Tal. Good ideas and recap there.

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

2021-05-23 Thread Christopher Barker
Thanks Tal for writing this up. A couple comments: 1) “Add a single new sentinel value, e.g. MISSING or Sentinel” (under rejected) I was one of the proponent of that -- but not as an alternative to having a stadardars way to create unique sentinels, but as an addition. That's kind of orthogonal

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

2021-05-23 Thread Luciano Ramalho
Here is a simple implementation of that Sentinel class: https://github.com/fluentpython/example-code-2e/blob/master/25-class-metaprog/sentinel/sentinel.py Tests in the same directory. That's not a real package yet, just a couple of super simple examples I may use in Fluent Python 2e. Cheers,

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

2021-05-23 Thread MRAB
On 2021-05-24 01:37, Luciano Ramalho wrote: Sorry about my detour into the rejected idea of a factory function. But how about this class-based API? class NotGiven(Sentinel): pass Now I can use NotGiven as the sentinel, and its default repr is . The repr of other singletons are the

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

2021-05-23 Thread Luciano Ramalho
Sorry about my detour into the rejected idea of a factory function. But how about this class-based API? class NotGiven(Sentinel): pass Now I can use NotGiven as the sentinel, and its default repr is . Behind the scenes we can have a SentinelMeta metaclass with all the magic that could be

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

2021-05-23 Thread Luciano Ramalho
On Sun, May 23, 2021 at 3:37 AM Tal Einat wrote: > I put up an early draft of a PEP on a branch in the PEPs repo: > https://github.com/python/peps/blob/sentinels/pep-.rst Thanks for that PEP, Tal. Good ideas and recap there. I think repr= should have a default: the name of the class within

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

2021-05-23 Thread Tal Einat
On Fri, May 21, 2021 at 5:33 PM Luciano Ramalho wrote: > > For the hard cases, I will read the upcoming 46-page "PEP 973: > Parameterized Sentinel Factory Factory API" ;-) I put up an early draft of a PEP on a branch in the PEPs repo: https://github.com/python/peps/blob/sentinels/pep-.rst

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

2021-05-21 Thread Steve Dower
On 5/21/2021 9:36 AM, Petr Viktorin wrote: On 21. 05. 21 3:23, Eric V. Smith wrote: On 5/20/2021 3:24 PM, Ronald Oussoren via Python-Dev wrote: One example of this is the definition of dataclasses.field: |dataclasses.||field|(/*/, /default=MISSING/, /default_factory=MISSING/, /repr=True/,

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

2021-05-21 Thread Luciano Ramalho
I was attracted to Python in 1998 because it seemed designed to make the simple cases simple, and the hard cases possible. My personal takeaway from this discussion: I will continue to advocate for the use of Ellipsis as a sentinel in the *many* cases where it is suitable. For the hard cases, I

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

2021-05-21 Thread Petr Viktorin
On 21. 05. 21 3:23, Eric V. Smith wrote: On 5/20/2021 3:24 PM, Ronald Oussoren via Python-Dev wrote: On 20 May 2021, at 19:10, Luciano Ramalho > wrote: I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is not a good sentinel. It's a pickable

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

2021-05-20 Thread Eric V. Smith
On 5/20/2021 3:24 PM, Ronald Oussoren via Python-Dev wrote: On 20 May 2021, at 19:10, Luciano Ramalho > wrote: I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is not a good sentinel. It's a pickable singleton testable with `is`, readily

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

2021-05-20 Thread micro codery
> > But it nevertheless feels like a bit of an abuse - the original point >> > of ellipsis was for indexing, and in particular complex slices like >> > a[1:20:2, ..., 3:5]. That usage is common in numpy, as I understand >> > it, >> Interesting -- do you know what ... means in that context? >>

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

2021-05-20 Thread Tal Einat
On Thu, May 20, 2021 at 10:37 PM David Mertz wrote: > > The scenario I'm thinking about is like this: > > (base) 84-tmp % python > Python 3.9.1 (default, Dec 11 2020, 14:32:07) > [GCC 7.3.0] :: Anaconda, Inc. on linux > Type "help", "copyright", "credits" or "license" for more information. > >>>

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

2021-05-20 Thread David Mertz
The scenario I'm thinking about is like this: (base) 84-tmp % python Python 3.9.1 (default, Dec 11 2020, 14:32:07) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pickle >>> cheap_sentinel = object() >>> id(cheap_sentinel)

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

2021-05-20 Thread Sebastian Berg
On Thu, 2021-05-20 at 19:00 +0100, Paul Moore wrote: > On Thu, 20 May 2021 at 18:13, Luciano Ramalho > wrote: > > > > I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) > > is > > not a good sentinel. It's a pickable singleton testable with `is`, > > readily available, and

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

2021-05-20 Thread Ronald Oussoren via Python-Dev
> On 20 May 2021, at 19:10, Luciano Ramalho wrote: > > I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is > not a good sentinel. It's a pickable singleton testable with `is`, > readily available, and extremely unlikely to appear in a data stream. > Its repr is "Ellipsis". >

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

2021-05-20 Thread Paul Moore
On Thu, 20 May 2021 at 20:06, Ethan Furman wrote: > > On 5/20/21 11:00 AM, Paul Moore wrote: > > > But it nevertheless feels like a bit of an abuse - the original point > > of ellipsis was for indexing, and in particular complex slices like > > a[1:20:2, ..., 3:5]. That usage is common in

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

2021-05-20 Thread David Mertz
On Thu, May 20, 2021 at 3:03 PM Ethan Furman wrote: > > But it nevertheless feels like a bit of an abuse - the original point > > of ellipsis was for indexing, and in particular complex slices like > > a[1:20:2, ..., 3:5]. That usage is common in numpy, as I understand > > it, > Interesting

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

2021-05-20 Thread Ethan Furman
On 5/20/21 10:47 AM, David Mertz wrote: > On Thu, May 20, 2021 at 6:21 AM Tal Einat wrote: >> I think it's worth preserving the idiom of comparing sentinels using >> `is`, as we do for `None` and other existing sentinel values. It's >> relatively easy to do, such as by using a single-value Enum

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

2021-05-20 Thread Ethan Furman
On 5/20/21 11:00 AM, Paul Moore wrote: > But it nevertheless feels like a bit of an abuse - the original point > of ellipsis was for indexing, and in particular complex slices like > a[1:20:2, ..., 3:5]. That usage is common in numpy, as I understand > it, Interesting -- do you know what ...

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

2021-05-20 Thread David Mertz
On Thu, May 20, 2021, 2:11 PM Chris Angelico > Probably the easiest way would be to have some kind of unique > identifier (a fully-qualified name) that can be pickled, and then any > time you attempt to construct a Sentinel with that identifier, it's > guaranteed to return the same object.

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

2021-05-20 Thread Chris Angelico
On Fri, May 21, 2021 at 3:51 AM David Mertz wrote: > > On Thu, May 20, 2021 at 6:21 AM Tal Einat wrote: >> >> On Sat, May 15, 2021 at 2:09 AM David Mertz wrote: >> > Just add a ._uuid attribute and have object equality follow equality of >> > that attribute. There's no reason to expose that in

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

2021-05-20 Thread Paul Moore
On Thu, 20 May 2021 at 18:13, Luciano Ramalho wrote: > > I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is > not a good sentinel. It's a pickable singleton testable with `is`, > readily available, and extremely unlikely to appear in a data stream. > Its repr is "Ellipsis".

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

2021-05-20 Thread David Mertz
On Thu, May 20, 2021 at 6:21 AM Tal Einat wrote: > On Sat, May 15, 2021 at 2:09 AM David Mertz wrote: > > Just add a ._uuid attribute and have object equality follow equality of > that attribute. There's no reason to expose that in the .__repr__, but it > would be inspectable in concept. > > I

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

2021-05-20 Thread Luciano Ramalho
I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is not a good sentinel. It's a pickable singleton testable with `is`, readily available, and extremely unlikely to appear in a data stream. Its repr is "Ellipsis". If you don't like the name for this purpose, you can always define

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

2021-05-20 Thread Victor Stinner
IMO you should consider writing a PEP to enhance sentinels in Python, and maybe even provide a public API for sentinels in general. Victor ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org

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

2021-05-20 Thread Tal Einat
On Sat, May 15, 2021 at 2:09 AM David Mertz wrote: > > I think it's more future-looking to allow pickle round-tripping. I tend to agree. > Just add a ._uuid attribute and have object equality follow equality of that > attribute. There's no reason to expose that in the .__repr__, but it would

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

2021-05-20 Thread Tal Einat
I've created a poll on this subject: https://discuss.python.org/t/sentinel-values-in-the-stdlib/8810 On Fri, May 14, 2021 at 10:33 PM Tal Einat wrote: > > On Fri, May 14, 2021 at 12:45 PM Steve Dower wrote: > > > > On 14May2021 0622, micro codery wrote: > > > > > > There was a discussion a

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

2021-05-15 Thread Eric Nieuwland
To add to the suggestions already given in this thread I dug into code I wrote some time ago. Offered as an inspiration. === missing.py === from typing import Any def MISSING(klass: Any) -> Any: """ create a sentinel to indicate a missing instance of a class :param klass: the

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

2021-05-14 Thread micro codery
I think that would be the primary motivating factor behind recommending Ellipsis, it’s already a builtin and we are not likely it to get another builtin singleton. Ever? But besides that “...” in a function signature, although maybe looking magical, does immediately call out to the reader that

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

2021-05-14 Thread Joao S. O. Bueno
Since the subject is this, I will note that past week, I resorted twice to create an Enum with a single element, and then alias the element on the module namespace, so that it would work as a "polished" sentinel. So: import enum class Whatever(enum.Enum): EMPTY = "EMPTY" EMPTY =

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

2021-05-14 Thread Nick Coghlan
On Sat, 15 May 2021, 5:39 am Tal Einat, wrote: (snip useful feature summary) The common `SENTINEL = object()` idiom fails #3, #4 and #5. This is > what I've been using for years, and I now think that it isn't good > enough. This not having a nice repr is what started this thread. > > I'd also

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

2021-05-14 Thread David Mertz
I think it's more future-looking to allow pickle round-tripping. Just add a ._uuid attribute and have object equality follow equality of that attribute. There's no reason to expose that in the .__repr__, but it would be inspectable in concept. On Fri, May 14, 2021, 7:01 PM Irit Katriel via

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

2021-05-14 Thread Irit Katriel via Python-Dev
If we drop the requirement for pickle round-tripping then I would add a requirement that sentinel is unpicklable, to prevent accidents. Irit On Fri, May 14, 2021 at 8:38 PM Tal Einat wrote: > > I'll try to organize my thoughts a bit here. This is a bit long, > welcome to skip to the final

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

2021-05-14 Thread Tal Einat
On Fri, May 14, 2021 at 12:45 PM Steve Dower wrote: > > On 14May2021 0622, micro codery 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

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

2021-05-14 Thread Barry Warsaw
On May 14, 2021, at 02:38, Chris Angelico wrote: > > Do we ever really need the ability to pass a specific sentinel to a > function, or are we actually looking for a way to say "and don't pass > this argument”? Very often, that’s the case. Such a “it’s okay to not pass this argument”

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

2021-05-14 Thread Chris Angelico
On Sat, May 15, 2021 at 2:04 AM Barry Warsaw wrote: > > On May 14, 2021, at 02:38, Chris Angelico wrote: > > > > Do we ever really need the ability to pass a specific sentinel to a > > function, or are we actually looking for a way to say "and don't pass > > this argument”? > > Very often,

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

2021-05-14 Thread Steve Dower
On 14May2021 0622, micro codery 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. Not quite true, we also have Ellipsis, which already has a

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

2021-05-14 Thread Chris Angelico
On Fri, May 14, 2021 at 7:31 PM Petr Viktorin wrote: > Perhaps it would be beneficial to provide a common base class or > factory, so we get a good repr. But I don't think another common value > like None and Ellipsis would do much good. > Agreed - I think Sentinel would make a great class, from

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

2021-05-14 Thread Petr Viktorin
On 14. 05. 21 10:55, Victor Stinner wrote: Hi Tal, Would it make sense to have an unique singleton for such sentinel, a built-in singleton like None or Ellipsis? I propose the name "Sentinel". Sentinel would be similar to None, but the main property would be that "Sentinel is None" is false

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

2021-05-14 Thread Victor Stinner
Hi Tal, Would it make sense to have an unique singleton for such sentinel, a built-in singleton like None or Ellipsis? I propose the name "Sentinel". Sentinel would be similar to None, but the main property would be that "Sentinel is None" is false :-) The stdlib contains tons of sentinels: *

[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: 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: 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: 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: 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: 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: 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: 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