Opened 3 years ago
Closed 3 years ago
#24260 closed enhancement (fixed)
Deprecate str ^ Integer
Reported by:  jdemeyer  Owned by:  

Priority:  major  Milestone:  sage8.1 
Component:  basic arithmetic  Keywords:  
Cc:  dkrenn  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Daniel Krenn 
Report Upstream:  N/A  Work issues:  
Branch:  5c1f43f (Commits, GitHub, GitLab)  Commit:  5c1f43f861165ff975616f60cab37c92d36d10f6 
Dependencies:  #24267  Stopgaps: 
Description
This is crazy:
sage: "abc" ^ 5 'abcabcabcabcabc'
We already have multiplication with the same behaviour and it's an error in Python:
>>> "abc" ** 5 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
Change History (8)
comment:1 Changed 3 years ago by
 Cc dkrenn added
comment:2 Changed 3 years ago by
 Branch set to u/jdemeyer/deprecate_str___integer
comment:3 Changed 3 years ago by
 Commit set to 5c1f43f861165ff975616f60cab37c92d36d10f6
 Status changed from new to needs_review
New commits:
5c1f43f  Deprecate str ^ Integer

comment:4 Changed 3 years ago by
The changes in asymptotic
are fine for me.
comment:5 followup: ↓ 6 Changed 3 years ago by
 Reviewers set to Daniel Krenn
+1 for this change. LGTM, i.e., positive_review once the patchbot confirms a pass.
comment:6 in reply to: ↑ 5 Changed 3 years ago by
 Status changed from needs_review to needs_work
Replying to dkrenn:
[...] positive_review once the patchbot confirms a pass.
sage t long src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py # 2 doctests failed
There seem to be two more occurrences...
comment:7 Changed 3 years ago by
 Dependencies set to #24267
 Status changed from needs_work to positive_review
comment:8 Changed 3 years ago by
 Branch changed from u/jdemeyer/deprecate_str___integer to 5c1f43f861165ff975616f60cab37c92d36d10f6
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
CC dkrenn because this affects some doctests in
asymptotic
.