bpo-30597: Shows expected input in custom 'print' error message by CuriousLearner · Pull Request #2009 · python/cpython

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the discussion on the issue tracker, we want to check for a trailing , here, and if so, also append end=' ' to request the Python 3 equivalent of Python 2's soft-space behaviour.

(That will also impact the working memory allocation - the simplest option would be to always allocate enough space to handle the suggest_end_arg case, since the working string will be null-terminated anyway)