Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pretty-print dicts or sets containing non-Expr objects #5306

Closed
rlamy opened this issue Mar 8, 2011 · 3 comments
Closed

Can't pretty-print dicts or sets containing non-Expr objects #5306

rlamy opened this issue Mar 8, 2011 · 3 comments

Comments

@rlamy
Copy link
Member

rlamy commented Mar 8, 2011

In isympy:

In [1]: {Basic(): 1, Basic(Basic()): 2}
<long traceback>
AttributeError: 'Basic' object has no attribute 'as_base_exp'

The problem is that Basic._compare_pretty() assumes that its arguments are instances of Expr.

Original issue for #5306: http://code.google.com/p/sympy/issues/detail?id=2207
Original author: https://code.google.com/u/101272611947379421629/
Original owner: https://code.google.com/u/101272611947379421629/

@rlamy
Copy link
Member Author

rlamy commented Jun 1, 2011

There's the same problem with sets. Basic._compare_pretty() is essentially broken and should be replaced with the new sort-key mechanism everywhere (cf. issue 4590 ).

I'm upping he priority on this because it's a serious usability problem for objects deriving from Basic but not from Expr.

**Summary:** Can't pretty-print dicts or sets containing non-Expr objects  
**Labels:** -Priority-Medium Priority-High Milestone-Release0.7.1  
**Blockedon:** 4590  

Referenced issues: #4590
Original comment: http://code.google.com/p/sympy/issues/detail?id=2207#c1
Original author: https://code.google.com/u/101272611947379421629/

@rlamy
Copy link
Member Author

rlamy commented Jun 3, 2011

It's actually easy to fix. There's a single line to change and a few tests to update.
I've added the commit to PR #326 ( https://github.com/sympy/sympy/pull/326 ).

**Status:** Started  
**Labels:** NeedsReview  
**Blockedon:** -1491  

Original comment: http://code.google.com/p/sympy/issues/detail?id=2207#c2
Original author: https://code.google.com/u/101272611947379421629/

@asmeurer
Copy link
Member

asmeurer commented Jun 4, 2011

This was pushed.

**Status:** Fixed  
**Labels:** -NeedsReview PassedReview  

Original comment: http://code.google.com/p/sympy/issues/detail?id=2207#c3
Original author: https://code.google.com/u/asmeurer@gmail.com/

@rlamy rlamy added this to the Release0.7.1 milestone Mar 7, 2014
@rlamy rlamy self-assigned this Mar 7, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants