Opened 4 years ago
Closed 4 years ago
#26271 closed enhancement (fixed)
Slight improvement to "rational is not an integer" exception message
Reported by:  embray  Owned by:  

Priority:  trivial  Milestone:  sage8.6 
Component:  misc  Keywords:  
Cc:  Merged in:  
Authors:  Erik Bray  Reviewers:  Jeroen Demeyer, Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  2cf5091 (Commits, GitHub, GitLab)  Commit:  2cf5091cf299b308c2c51e5a10e031dcfa2f6fe0 
Dependencies:  Stopgaps: 
Description
This is a change I had in my Python 3 branch that at some point I think I found helpful for debugging something; I can't even remember what. But it still seemed like a worthwhile change.
Change History (10)
comment:1 Changed 4 years ago by
 Status changed from new to needs_review
comment:2 Changed 4 years ago by
comment:3 Changed 4 years ago by
Also in Cython files you an use fstrings:
raise TypeError(f"unable to convert rational {self} to an integer")
comment:4 Changed 4 years ago by
 Status changed from needs_review to needs_work
You have #26270 merged in here.
comment:5 Changed 4 years ago by
Oops. And yes, I agree.
comment:6 Changed 4 years ago by
 Commit changed from adba5880c80b3beb04c6ba6a37be7776413ec1e5 to 2cf5091cf299b308c2c51e5a10e031dcfa2f6fe0
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
2cf5091  make these exception messages a little more informative

comment:7 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:8 Changed 4 years ago by
 Milestone changed from sage8.4 to sage8.5
comment:9 Changed 4 years ago by
 Milestone changed from sage8.5 to sage8.6
 Reviewers set to Jeroen Demeyer, Marc Mezzarobba
 Status changed from needs_review to positive_review
comment:10 Changed 4 years ago by
 Branch changed from u/embray/misc/rationalnotanintegerexception to 2cf5091cf299b308c2c51e5a10e031dcfa2f6fe0
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
If you're changing that message anyway, can you change it to
unable to convert rational {} to an integer
to be more consistent with other error messages of the same kind?