Homonyms are words spelled the same way with different meanings, like bat
(flying mammal) and bat (club used to hit a baseball) (btw, club (a blunt
instrument) and club (a closed association of people))...

In 22 years of programming Python, I always understood the "pass" keyword
as "to forgo an opportunity to act".

Of course, I also use "pass" as the opposite of "fail" in tests, but that
was never the meaning of the *pass keyword* for me.

Anyway, I subscribe 100% to Emily Bowman's position: "Reserving a common
English word as a new keyword (whether fail or impossible) is the mother of
all breaking changes." And the benefit is negative.

Cheers,

Luciano






On Fri, Oct 23, 2020 at 4:42 PM Umair Ashraf <umr.as...@gmail.com> wrote:

> Hello
>
> Can I suggest a feature to discuss and hopefully develop and send a PR. I
> think having a *fail* keyword for unit testing would be great. So we
> write a test as follows which will fail to begin with.
>
> class MyTest(unittest.TestCase):
>    def test_this_and_that(self):
>       """
>       Given inputs
>       When action is done
>       Then it should pass
>       """
>       fail
>
> This keyword is to fill an empty function block like *pass* but this will
> make the function raise an exception that test is failing. I know there is
> *raise* but I feel this *fail* keyword is needed to write a test first
> which fails and then write code and then come back to the test and fill its
> body.
>
> Umair
>
> --
>
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/QPOVO34K63CLEY66GSY5JOLWBRG5QRUM/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
Luciano Ramalho
|  Author of Fluent Python (O'Reilly, 2015)
|     http://shop.oreilly.com/product/0636920032519.do
|  Technical Principal at ThoughtWorks
|  Twitter: @ramalhoorg
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/KV7HDSQKSIGZHTUVPTKTMDNIN6CKVWNE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to