Bug 1846433 - init_printing(order='rev-lex') does not work
Summary: init_printing(order='rev-lex') does not work
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: sympy
Version: 32
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-11 15:11 UTC by Herbert Carl Meyer
Modified: 2021-05-25 17:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-25 17:43:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Herbert Carl Meyer 2020-06-11 15:11:49 UTC
Description of problem:

This is an example from "Doing Math with Python", published by no starch press, chap 4.

Version-Release number of selected component (if applicable):
 sympy 1.6 ?

How reproducible:
100%

Steps to Reproduce:
idle session:

Python 3.8.3 (default, May 15 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>> from sympy import symbol
>>> from sympy import Symbol
>>> x = Symbol( 'x')
>>> y = Symbol( 'y')
>>> expr = 1 + 2*x + 2*x**2
>>> expr
2*x**2 + 2*x + 1
>>> from sympy import pprint
>>> expr
2*x**2 + 2*x + 1
>>> pprint( expr)
   2          
2⋅x  + 2⋅x + 1
>>> from sympy import init_printing
>>> init_printing( order='rev-lex')
>>> pprint(expr)
   2          
2⋅x  + 2⋅x + 1
>>> init_printing()
>>> init_printing( order='rev-lex')
>>> pprint(expr)
   2          
2⋅x  + 2⋅x + 1
>>> 

Expected results:
                                   2
expr should pprint as 1 + 2⋅x + 2⋅x  in reverse lexicographic order

Additional info:

Ubuntu 20.04 produces expected result, but I am not sure about sympy version

Comment 1 Jerry James 2020-06-11 15:43:14 UTC
This may be a change in sympy 1.6, as I do not see rev-lex mentioned in the documentation for init_printing():

https://docs.sympy.org/latest/modules/interactive.html

On the other hand, this works:

>>> pprint(expr, order='rev-lex')
             2
1 + 2⋅x + 2⋅x

Comment 2 Herbert Carl Meyer 2020-06-12 02:20:08 UTC
Thank you, I can proceed with the textbook, using order='rev-lex' as an argument to pprint. Just more typing.

Comment 3 Fedora Program Management 2021-04-29 17:03:50 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2021-05-25 17:43:09 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.