Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#26418 closed defect (fixed)

py3: fix int argument check in Matrix_integer_dense.__pow__

Reported by: Erik Bray Owned by:
Priority: major Milestone: sage-8.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:

Status badges

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 git

Commit: f8beaa62435d0ee554a42652f5defa5d9286afad

Branch pushed to git repo; I updated commit sha1. New commits:

f8beaa6py3: fix int argument check in Matrix_integer_check.__pow__

comment:2 Changed 4 years ago by git

Commit: f8beaa62435d0ee554a42652f5defa5d9286afad1e1a323ca32dc4406d3be20b247b140cfe0e4e72

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

1e1a323py3: fix int argument check in Matrix_integer_dense.__pow__

comment:3 Changed 4 years ago by Erik Bray

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

Last edited 4 years ago by Erik Bray (previous) (diff)

comment:4 Changed 4 years ago by Erik Bray

Status: newneeds_review

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

Reviewers: Frédéric Chapoton
Status: needs_reviewpositive_review

ok, let it be

comment:6 Changed 4 years ago by Volker Braun

Branch: u/embray/python3/sage-matrix-matrix_integer_dense/fix_pow1e1a323ca32dc4406d3be20b247b140cfe0e4e72
Resolution: fixed
Status: positive_reviewclosed

comment:7 Changed 4 years ago by Jeroen Demeyer

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 Erik Bray

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.

comment:9 Changed 4 years ago by Erik Bray

Milestone: sage-8.4sage-8.5

This should be re-targeted for 8.5.

Note: See TracTickets for help on using tickets.