On Mon, 10 Jan 2022 at 08:39, Victor Stinner <vstin...@python.org> wrote:

> Does someone know if linters like pylint or pylakes current warn on
> "assert(test, msg)" statements?
>
> If a project use such assertions which are always true, they can start
> failing wit the PEP 679, right?


OTOH, any assertion which start failing in this way, is a statement which
_should_ have been failing from the start, and was being ignored up to
this change.

While it can indeed, make otherwise stable projects with "nop"s assert
sudden failing, that should be a trivial fix for any non-unmaintained
project.

+1 to the change




> Hopefully, the fix is easy: removing
> the parenthesis give the same behavior on old and new Python versions.
>
> (it will behave the same just if the first expression is actually truish)


> Is it possible to run a code search on PyPI top 5000 projects to see
> if such always-true assertion is common or not?
>
> Victor
>
> On Mon, Jan 10, 2022 at 1:22 AM Pablo Galindo Salgado
> <pablog...@gmail.com> wrote:
> >
> > Hi everyone,
> >
> > I would like to start a discussion about a small PEP proposal to allow
> parentheses in
> > assert statements to fix a common gotcha with assert statements.
> >
> > Link to the PEP: https://www.python.org/dev/peps/pep-0679/
> >
> > Please, redirect all discussions to:
> >
> >
> https://discuss.python.org/t/pep-679-allow-parentheses-in-assert-statements/13003
> >
> > as I will not be monitoring answers to this thread.
> >
> > Thanks, everyone for your time!
> >
> > Regards from cloudy London,
> > Pablo Galindo Salgado
> > _______________________________________________
> > 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/I7MKCD3GHJXCERFCZ2FD3X7IPAX6ASVK/
> > Code of Conduct: http://python.org/psf/codeofconduct/
>
>
>
> --
> Night gathers, and now my watch begins. It shall not end until my death.
> _______________________________________________
> 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/LFQGI43BH3SWKHRBPO7T3DC6SEU5HMQ3/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
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/SFBWV5SAFYRFEASNJZJIRY4VUPIEOX24/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to