docs: add s += t/s *= n Operation#142611
Conversation
| +--------------------------+--------------------------------+----------+ | ||
| | ``s * n`` or | equivalent to adding *s* to | (2)(7) | | ||
| | ``n * s`` | itself *n* times | | | ||
| | ``n * s`` or ``s *= n`` | itself *n* times | | |
There was a problem hiding this comment.
I don't think the second form is an equivalent of n * s. Ditto for concatenation.
Rather you could extend the footnote to mention that some sequence types have support for in-place concatenation (or repetition).
|
I don't think these need to be documented specifically here. The place where they do need to be documented specifically is for mutable sequence types, and we already do this. |
picnixz
left a comment
There was a problem hiding this comment.
Those forms are not equivalent because they combine two thing: the operation and the re-assignment. in particular, when writing s *= n, we're modifing s in place. In addition (6) says that "Concatenating immutable sequences always results in a new object" and thus the note is no more correct.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I missed that comment. Considering this comment and mine, I'm going to close this. Sorry. |
📚 Documentation preview 📚: https://cpython-previews--142611.org.readthedocs.build/