t's given me the opportunity
to correct a typo & do some slight reformatting. Here's it is:
On Thu, 9 Dec 2021 at 07:25, Adam Johnson wrote:
>
> On Fri, 3 Dec 2021 at 22:38, Chris Angelico wrote:
> >
> > On Sat, Dec 4, 2021 at 6:33 AM Adam Johnson w
On Wed, 1 Dec 2021 at 06:19, Chris Angelico wrote:
>
> I've just updated PEP 671 https://www.python.org/dev/peps/pep-0671/
> with some additional information about the reference implementation,
> and some clarifications elsewhere.
>
> *PEP 671: Syntax for late-bound function argument defaults*
>
>
On Sat, 29 Aug 2020 at 15:12, Ricky Teachey wrote:
>
> But if we want to have the same behavior without supporting function
> style syntax, we will have to write code like this:
>
> MISSING = object()
>
> def __getitem__(self, key, x=MISSING, y=MISSING):
> if x is MISSING and y is MISSING::
>
On Mon, 4 May 2020 at 12:41, Steven D'Aprano wrote:
>
> On Sun, May 03, 2020 at 11:13:58PM -0400, David Mertz wrote:
>
> > It seems to me that a Python implementation of zip_equals() shouldn't do
> > the check in a loop like a version shows (I guess from more-itertools).
> > More obvious is the fo
Peeking at the source for Enum, the __new__ method is explicitly called,
thereby deferring the call to __init__ until it, too, is explicitly
called, but only after member's _name_ attribute has been assigned. So,
adapting your example:
class ChoiceEnum(Enum):
def __init__(self, value):
On Sat, 1 Dec 2018 at 10:44, Greg Ewing wrote:
> It's not -- the StopIteration isn't terminating the map,
> it's terminating the iteration being performed by tuple().
That was a poor choice of wording on my part, it's rather that map
doesn't do anything special in that regard. To whatever is iter
On Sat, 1 Dec 2018 at 01:17, Steven D'Aprano wrote:
>
> In principle, we could make this work, by turning the output of map()
> into a view like dict.keys() etc, or a lazy sequence type like range().
> wrapping the underlying sequence. That might be worth exploring. I can't
> think of any obvious