[issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple

Gregory P. Smith report at bugs.python.org
Thu Dec 23 15:35:19 EST 2021


Gregory P. Smith <greg at krypto.org> added the comment:

It's not about an advantage, it's about removing the problem of what edit to make when working on


assert thing_that_has_a_meaningful_name.methods_have_good_names(value_from_somewhere) == other_thing_that_is_meaningful, "Description of what the issue is if this fails for humans, as if the names weren't enough"

and making that fit within whatever line length limit your codebase has.

put () in the wrong place and it triggers the long standing Python wart or parsing as a tuple.

rather than warn about the syntax wart, we should just do the thing code authors want in the first place.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________


More information about the Python-bugs-list mailing list