#26418 closed defect (fixed)
py3: fix int argument check in Matrix_integer_dense.__pow__
Reported by:  Erik Bray  Owned by:  

Priority:  major  Milestone:  sage8.5 
Component:  python3  Keywords:  
Cc:  Merged in:  
Authors:  Erik Bray  Reviewers:  Frédéric Chapoton 
Report Upstream:  N/A  Work issues:  
Branch:  1e1a323 (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description
Doesn't work on Python 3 since int
cannot be safely cast to a C long
.
Change History (9)
comment:1 Changed 4 years ago by
Commit:  → f8beaa62435d0ee554a42652f5defa5d9286afad 

comment:2 Changed 4 years ago by
Commit:  f8beaa62435d0ee554a42652f5defa5d9286afad → 1e1a323ca32dc4406d3be20b247b140cfe0e4e72 

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
1e1a323  py3: fix int argument check in Matrix_integer_dense.__pow__

comment:3 Changed 4 years ago by
Summary:  py3: fix int argument check in Matrix_integer_check.__pow__ → py3: fix int argument check in Matrix_integer_dense.__pow__ 

a little dyslexia; time for a break
comment:4 Changed 4 years ago by
Status:  new → needs_review 

comment:5 Changed 4 years ago by
Reviewers:  → Frédéric Chapoton 

Status:  needs_review → positive_review 
ok, let it be
comment:6 Changed 4 years ago by
Branch:  u/embray/python3/sagematrixmatrix_integer_dense/fix_pow → 1e1a323ca32dc4406d3be20b247b140cfe0e4e72 

Resolution:  → fixed 
Status:  positive_review → closed 
comment:7 Changed 4 years ago by
Commit:  1e1a323ca32dc4406d3be20b247b140cfe0e4e72 

A hint for next time: it would have been better to just use the coercion framework for this: __pow__
should be replaced by _pow_
or _pow_int
.
comment:8 Changed 4 years ago by
To this day I still don't have a solid understanding of how the coercion framework works and when to use _pow_
versus __pow__
for example.
In this case it was fixing an already existing __pow__
but if you think this should be changed (and I don't disagree; I just don't know why) perhaps there should be a ticket for that.
Branch pushed to git repo; I updated commit sha1. New commits:
py3: fix int argument check in Matrix_integer_check.__pow__