Opened 3 years ago

Closed 3 years ago

#24260 closed enhancement (fixed)

Deprecate str ^ Integer

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

Status badges

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 jdemeyer

  • Cc dkrenn added

CC dkrenn because this affects some doctests in asymptotic.

comment:2 Changed 3 years ago by jdemeyer

  • Branch set to u/jdemeyer/deprecate_str___integer

comment:3 Changed 3 years ago by jdemeyer

  • Commit set to 5c1f43f861165ff975616f60cab37c92d36d10f6
  • Status changed from new to needs_review

New commits:

5c1f43fDeprecate str ^ Integer

comment:4 Changed 3 years ago by dkrenn

The changes in asymptotic are fine for me.

comment:5 follow-up: Changed 3 years ago by dkrenn

  • 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 dkrenn

  • 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 jdemeyer

  • Dependencies set to #24267
  • Status changed from needs_work to positive_review

comment:8 Changed 3 years ago by vbraun

  • 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.