[Python-ideas] Power Assertions: Is it PEP-able?

2021-09-12 Thread noam
Hi all, I’d like your comments and feedback on an enhancement that introduces power assertions to the Python language. Proposal This feature is inspired by a similar feature of the Groovy language[1], and is effectively a variant of the `assert` keyword. When an assertion expression ev

[Python-ideas] Re: Power Assertions: Is it PEP-able?

2021-09-12 Thread noam
> This is cool. Thank you. Much appreciated. > AFAIK pytest does something like this. How does your implementation differ? The pytest implementation is very powerful in the way of hints and suggestions that point to the difference and source, but when the asserted expression has more than one su

[Python-ideas] Re: Power Assertions: Is it PEP-able?

2021-09-12 Thread noam
2QdxY4RzWzUUiLuE@potatochowder.com wrote: > On 2021-09-12 at 07:28:53 -0700, > Guido van Rossum gu...@python.org wrote: > > What about asserts that are not used for testing, but as classic > > “unless there’s a bug, this should hold”? Those may not want to incur > > the extra cost. > > I was actual

[Python-ideas] Re: Power Assertions: Is it PEP-able?

2021-09-12 Thread noam
> Maybe you all could collaborate on a PEP? This sounds a worthy topic. . Yes, I would love that please. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman

[Python-ideas] PEP Draft: Power Assertion

2021-09-24 Thread Noam Tenne
Hi All, Following the discussions on "Power Assertions: Is it PEP-able?", I've drafted this PEP. Your comments are most welcome. PEP: Title: Power Assertion Author: Noam Tenne Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 24-Sep-2021 Abstract ===

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Noam Tenne
Will do! On Fri, Sep 24, 2021, at 14:10, Paul Moore wrote: > On Fri, 24 Sept 2021 at 12:05, Noam Tenne wrote: > > > Caveats > > --- > > > > It is important to note that expressions with side effects are affected by > > this feature. This is because in o

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Noam Tenne
utils and setuptools— > officially accept that a full featured test framework will be left to third > parties. > > NOTE: if the proposal does require actual language changes beyond the current > introspection options, that should be made clear. > > -CHB > >

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Noam Tenne
>Is there no room for making it easier to do this with less invasive changes to the stdlib, or are Steven d'A's "heroic measures in an import hook" the right way to go? I'm not familiar with this, can you please elaborate? >From what I understand we can change stdlib to the point of manipulating

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Noam Tenne
So should I just scratch this and rewrite a PEP for an extensible assertion mechanism? On Fri, Sep 24, 2021, at 14:04, Noam Tenne wrote: > Hi All, > > Following the discussions on "Power Assertions: Is it PEP-able?", I've > drafted this PEP. > Your comments ar

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Noam Tenne
Thank you On Sat, Sep 25, 2021, at 18:53, Guido van Rossum wrote: > First you need to fond a core dev to sponsor you (Steven D’A?). That person > will guide you through the process. > > On Sat, Sep 25, 2021 at 08:30 Noam Tenne wrote: >> __ >> So should I just scratc

[Python-ideas] Function suggestion: itertools.one()

2020-07-28 Thread Noam Yorav-Raphael
ier to replace _[0] with one(_) than to be required to name a new variable, and instead of having an operation on the iterable, change the way I'm assigning to it. WDYT? Cheers, Noam ___ Python-ideas mailing list -- python-ideas@python.org To

[Python-ideas] Re: Function suggestion: itertools.one()

2020-07-28 Thread Noam Yorav-Raphael
Thanks! It's good to hear that you too find it useful. Since adding methods to built-in types is much heavier than adding one function to a module, l suggest keeping this discussion focused on adding just the one() function to itertools, and see if there is enough support for this. Cheers,