Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace __getslice__ with functionality in __getitem__ in several files #12041

Closed
a-andre opened this issue Nov 15, 2011 · 8 comments
Closed

Comments

@a-andre
Copy link

a-andre commented Nov 15, 2011

__getslice__ has been deprecated for a long time in Python. This patch adds equivalent functionality to __getitem__, which is where the functionality should be.

CC: @kini

Component: build

Author: André Apitzsch

Reviewer: François Bissey

Merged: sage-4.8.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/12041

@a-andre
Copy link
Author

a-andre commented Nov 15, 2011

Attachment: trac_12041_replace_getslice.patch.gz

@kiwifb
Copy link
Member

kiwifb commented Nov 15, 2011

comment:2

I have been waiting for this for a long time. I would have done it myself but I don't have the know-how. I'll check you have done everything. I actually thought some of these bits were dead code.

@kiwifb
Copy link
Member

kiwifb commented Nov 15, 2011

comment:4

Could you do these files as well:

warning: sage/modules/free_module_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/modules/free_module_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polydict.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_gf2x.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_zmod_flint.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_zz_pex.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
warning: sage/structure/parent.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead

@a-andre
Copy link
Author

a-andre commented Nov 15, 2011

comment:5

If it's okay I will do this later in another ticket. So it should be easier to review.

BTW. these files don't contain any __*slice__ function

sage/rings/polynomial/polynomial_gf2x.pyx
sage/rings/polynomial/polynomial_zmod_flint.pyx
sage/rings/polynomial/polynomial_zz_pex.pyx

@kiwifb
Copy link
Member

kiwifb commented Nov 15, 2011

comment:6

I would be OK with that. I confess I didn't manually check all the files. I think it is because they include the following file:polynomial_template.pxi which does have "slice".

@kiwifb
Copy link
Member

kiwifb commented Nov 25, 2011

comment:7

The title of the ticket is replace getslice in several files, not "all files" so I am inclined to give this a positive review in that any work on this is good. But more work will be needed in this area.

@jdemeyer
Copy link

Reviewer: François Bissey

@jdemeyer
Copy link

Merged: sage-4.8.alpha3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants