| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Thanks for the PR! Left a few minor comments, otherwise looks good.
Sorry, something went wrong.
|
|
||
| * ``tup[n]`` (integer index) | ||
| * ``tup[n:m]``, ``tup[n:]``, ``tup[:m]`` (slicing) | ||
| * ``tup1 + tup2`` |
There was a problem hiding this comment.
Is this only specialized for variable-length tuples? If yes, it's worth adding a note here, since fixed-length tuple concatenation could be quite slow otherwise.
Sorry, something went wrong.
There was a problem hiding this comment.
It should work for fixed-length tuple as well. Just the whole box / unbox dance which could possibly be optimized further at a later point.
Sorry, something went wrong.
| assert [1, 2] + [3, 4] == res | ||
| with assertRaises(TypeError, 'can only concatenate list (not "tuple") to list'): | ||
| assert [1, 2] + (3, 4) == res # type: ignore[operator] | ||
| assert in_place_add([3, 4]) == res |
There was a problem hiding this comment.
Test that the identity of the target object is preserved in +=?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://docs.python.org/3/c-api/sequence.html#c.PySequence_Concat
https://docs.python.org/3/c-api/sequence.html#c.PySequence_InPlaceConcat