Opened 3 years ago
Closed 3 years ago
#24350 closed enhancement (fixed)
SageObject.__repr__(): fall back to base class
Reported by: | jdemeyer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.2 |
Component: | misc | Keywords: | |
Cc: | Merged in: | ||
Authors: | Jeroen Demeyer | Reviewers: | Travis Scrimshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | fc4461d (Commits) | Commit: | fc4461d21d277c5616df36cf4f32aadb5b7ba454 |
Dependencies: | Stopgaps: |
Description (last modified by )
SageObject.__repr__(self)
tries to call self._repr_()
. If that method does not exist, it confusingly falls back to returning str(type(self))
. Instead, it would be better to fall back to super().__repr__()
.
Change History (16)
comment:1 Changed 3 years ago by
- Branch set to u/jdemeyer/sageobject___repr______fall_back_to_base_class
comment:2 Changed 3 years ago by
- Commit set to 4dc09b4a7831ea07088639a718f1354fed266cae
- Status changed from new to needs_review
comment:3 Changed 3 years ago by
- Description modified (diff)
comment:4 Changed 3 years ago by
- Commit changed from 4dc09b4a7831ea07088639a718f1354fed266cae to 4de00b1b641795e64e7247d67550c69f3c304c76
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
4de00b1 | SageObject.__repr__(): fall back to base class
|
comment:5 follow-up: ↓ 7 Changed 3 years ago by
- Reviewers set to Travis Scrimshaw
It took me a moment to realize why the current behavior is wrong (or at least highly misleading), but once I did, this is definitely what should be done. Positive review if the patchbot comes back green.
comment:6 Changed 3 years ago by
- Status changed from needs_review to positive_review
comment:7 in reply to: ↑ 5 Changed 3 years ago by
Replying to tscrim:
It took me a moment to realize why the current behavior is wrong (or at least highly misleading), but once I did, this is definitely what should be done.
Indeed. It's also the kind of thing where you wonder why nobody noticed this before...
comment:8 Changed 3 years ago by
The old behaviour dates back to
commit 0cd022a9fac32d648b25b59564428355c2fa395f Author: William Stein <wstein@ucsd.edu> Date: Tue Jun 6 21:59:47 2006 +0000 [project @ notebook -- first alpha version of the new SAGE notebook: ] type notebook() at the SAGE prompt to try it out!
comment:10 Changed 3 years ago by
- Commit changed from 4de00b1b641795e64e7247d67550c69f3c304c76 to 120e4e366fd8327bb159ea4def3ac47bb5d1710d
Branch pushed to git repo; I updated commit sha1. New commits:
120e4e3 | Merge tag '8.2.beta0' into t/24350/sageobject___repr______fall_back_to_base_class
|
comment:11 Changed 3 years ago by
- Commit changed from 120e4e366fd8327bb159ea4def3ac47bb5d1710d to ee717d3abf04b2dcce59c270b344b28f21df92e7
Branch pushed to git repo; I updated commit sha1. New commits:
ee717d3 | Trivial doctest fix
|
comment:12 Changed 3 years ago by
- Commit changed from ee717d3abf04b2dcce59c270b344b28f21df92e7 to fc4461d21d277c5616df36cf4f32aadb5b7ba454
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
fc4461d | Fix a few doctests
|
comment:13 Changed 3 years ago by
- Status changed from needs_work to needs_review
I accidentally hard-coded the Sage version number in a few doctests. Last commit needs review.
comment:14 Changed 3 years ago by
Patchbot is green.
comment:15 Changed 3 years ago by
- Status changed from needs_review to positive_review
comment:16 Changed 3 years ago by
- Branch changed from u/jdemeyer/sageobject___repr______fall_back_to_base_class to fc4461d21d277c5616df36cf4f32aadb5b7ba454
- Resolution set to fixed
- Status changed from positive_review to closed
New commits:
SageObject.__repr__(): fall back to base class