Issue 1674228: sq_ass_slice ignored if sq_slice not defined (original) (raw)

Issue1674228

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/44662

classification

Title: sq_ass_slice ignored if sq_slice not defined
Type: Stage:
Components: Interpreter Core Versions: Python 2.5

process

Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, zseil
Priority: normal Keywords: patch

Created on 2007-03-05 17:20 by zseil, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
assign_slice_trunk.diff zseil,2007-03-05 17:20 patch against trunk revision 54138
assign_slice_25.diff zseil,2007-03-05 17:22 patch against release25-maint branch revision 54138
Messages (3)
msg52061 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2007-03-05 17:20
Function assign_slice in ceval.c is checking for the presence of type->tp_as_sequence->tp_slice method instead of type->tp_as_sequence->tp_ass_slice method. This means that simple slice assignment fails for classes that have a __setslice__ method, but are missing a __getslice__ method (see the test in the patch). The change shouldn't break any code that worked before, so I think that it can be safely backported.
msg52062 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2007-03-05 17:22
File Added: assign_slice_25.diff
msg52063 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-05 22:28
Committed as rev. 54139, 54140 (2.5).
History
Date User Action Args
2022-04-11 14:56:22 admin set github: 44662
2007-03-05 17:20:00 zseil create

Supported by The Python Software Foundation,
Powered by Roundup

Copyright © 1990-2022, Python Software Foundation
Legal Statements