Opened 3 years ago
Closed 5 months ago
#22390 closed enhancement (fixed)
Support for unary plus in sage_input expressions
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage9.1 
Component:  symbolics  Keywords:  
Cc:  vdelecroix, vbraun, tscrim  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  fcbc478 (Commits)  Commit:  fcbc4789c76b7e4abace550ff4890595809e5272 
Dependencies:  Stopgaps: 
Description (last modified by )
This ticket adds support for unary plus in sage_input expressions.
Change History (20)
comment:1 Changed 3 years ago by
 Branch set to u/mkoeppe/support_for_unary_plus_in_sage_input_expressions
comment:2 Changed 3 years ago by
 Cc vdelecroix added
 Commit set to 94366b0b3fe02bc42ef1e188653b1cc850ac0a67
 Description modified (diff)
 Status changed from new to needs_review
comment:3 Changed 3 years ago by
 Cc vbraun added
comment:4 Changed 23 months ago by
 Cc tscrim added
 Milestone changed from sage7.6 to sage8.4
comment:5 followup: ↓ 10 Changed 6 months ago by
+ elif op == '+': + prec = _prec_negate
Shouldn't there be instead a
_prec_negate = 28
+_prec_positive = 29
_prec_bitnot = 30
(BTW the section 5.14 of the Python reference manual is now 6.16 "Operator precedence")
comment:6 Changed 6 months ago by
 Milestone changed from sage8.4 to sage9.1
 Status changed from needs_review to needs_info
comment:7 Changed 6 months ago by
Sorry, I lost track of this ticket. Also, minor point but since this is considered formal writing don't
> do not
, and also unary +.::
> unary +::
as the .::
will become .:
in the compiled documentation. If you really want the period, then use unary +. ::
will get rid of the colon in the compiled doc.
comment:8 Changed 6 months ago by
 Commit changed from 94366b0b3fe02bc42ef1e188653b1cc850ac0a67 to 8c6012dc067ce0c92cd271757be79ff6b5bd44cc
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
8c6012d  Support unary plus in sage_input expressions

comment:9 Changed 6 months ago by
 Commit changed from 8c6012dc067ce0c92cd271757be79ff6b5bd44cc to 64e741d7e9f7974d45ba16c7fc232c4a34b5ccd4
Branch pushed to git repo; I updated commit sha1. New commits:
64e741d  Update reference to the Python reference manual

comment:10 in reply to: ↑ 5 Changed 6 months ago by
Replying to vdelecroix:
+ elif op == '+': + prec = _prec_negateShouldn't there be instead a
_prec_negate = 28 +_prec_positive = 29 _prec_bitnot = 30
No, both in Python 2 and Python 3 unary + and  have the same precedence. (Also ~ (bitnot) has the same precedence as these two, but I consider it outside the scope of this ticket to fix this.)
comment:11 Changed 6 months ago by
 Commit changed from 64e741d7e9f7974d45ba16c7fc232c4a34b5ccd4 to fcbc4789c76b7e4abace550ff4890595809e5272
Branch pushed to git repo; I updated commit sha1. New commits:
fcbc478  Docstring fix

comment:12 Changed 6 months ago by
 Status changed from needs_info to needs_review
comment:13 Changed 5 months ago by
Ready for review
comment:14 Changed 5 months ago by
Is there still an interest in this ticket?
comment:15 Changed 5 months ago by
Sure, but I am confused about the priorities.
comment:16 Changed 5 months ago by
(I meant operator precedence)
comment:17 Changed 5 months ago by
 Reviewers set to Vincent Delecroix
comment:18 Changed 5 months ago by
 Status changed from needs_review to positive_review
comment:19 Changed 5 months ago by
Thank you!
comment:20 Changed 5 months ago by
 Branch changed from u/mkoeppe/support_for_unary_plus_in_sage_input_expressions to fcbc4789c76b7e4abace550ff4890595809e5272
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
Support unary plus in sage_input expressions