You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
string_processing: Handle overloaded operators when splitting long strings #2334
I'm not sure how often pathlib.Path is used with the augmented assignment operator rather than the regular one (/) nor do I know how often the string would be long enough that it would need to be split but all that aside, /= can definitely appear with strings on the right-hand of the assignment operator too:
changed the title [-]I'm not sure how often `pathlib.Path` is used with the augmented assignment operator rather than the regular one (`/`) nor do I know how often the string would be long enough that it would need to be split but all that aside, `/=` can definitely appear with strings on the right-hand of the assignment operator too:[/-][+]Handle overloaded operators when splitting long strings[/+]on Jun 13, 2021
@jack1142 Raises a good point here. This issue of no current support for long string splitting with the /= operator extends to many other operators that are not traditionally supported by strings. In other words, since essentially any operator can be overloaded to support strings, we need to support them all.
changed the title [-]Handle overloaded operators when splitting long strings[/-][+]string_processing: Handle overloaded operators when splitting long strings[/+]on Jan 30, 2024
Implemented in #5562, covering all 13 binary arithmetic/bitwise operators and
all 13 augmented assignments rather than just /=. The change stays within
the existing unstable string_processing feature.
The PR includes operator/width-boundary regressions, %-precedence safeguards,
documentation, and same-condition before/after CLI screenshots and a short
recording. Local validation passed: 629 regular tests, 82 Jupyter tests,
repository pre-commit, self-formatting and the strict docs build. The optional
IPython skip in tox's no-Jupyter phase and the local environment/verification
limits are documented in the PR. Hosted Actions still require maintainer
approval; local results are not a claim of hosted CI or maintainer approval.
Activity
[-]I'm not sure how often `pathlib.Path` is used with the augmented assignment operator rather than the regular one (`/`) nor do I know how often the string would be long enough that it would need to be split but all that aside, `/=` can definitely appear with strings on the right-hand of the assignment operator too:[/-][+]Handle overloaded operators when splitting long strings[/+]felix-hilden commentedon Jun 13, 2021
Thanks for reporting! I think since these keep coming, we ought to consider the full set of possible operators.
bbugyi200 commentedon Jun 13, 2021
@jack1142 Raises a good point here. This issue of no current support for long string splitting with the
/=operator extends to many other operators that are not traditionally supported by strings. In other words, since essentially any operator can be overloaded to support strings, we need to support them all.bbugyi200 commentedon Jun 13, 2021
@felix-hilden Beat me by 19 seconds ;).
JelleZijlstra commentedon Jan 29, 2022
To be more concrete, the problem here is:
This should split up the string literal to make it fit in 20 characters.
[-]Handle overloaded operators when splitting long strings[/-][+]string_processing: Handle overloaded operators when splitting long strings[/+]ZXLyyds100 commentedon Oct 18, 2026
Implemented in #5562, covering all 13 binary arithmetic/bitwise operators and
all 13 augmented assignments rather than just
/=. The change stays withinthe existing unstable
string_processingfeature.The PR includes operator/width-boundary regressions,
%-precedence safeguards,documentation, and same-condition before/after CLI screenshots and a short
recording. Local validation passed: 629 regular tests, 82 Jupyter tests,
repository pre-commit, self-formatting and the strict docs build. The optional
IPython skip in tox's no-Jupyter phase and the local environment/verification
limits are documented in the PR. Hosted Actions still require maintainer
approval; local results are not a claim of hosted CI or maintainer approval.