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

poly cannot generically be rebuilt from its args #10292

Open
MooVI opened this Issue Dec 20, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@MooVI
Copy link
Contributor

MooVI commented Dec 20, 2015

In [18]: expr = poly(1,x)
In [19]: expr.func(*expr.args)
GeneratorsNeeded: specify generators to give 1 a meaning

Isn't it supposed to be a general property that we can rebuild expressions like this?

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Dec 20, 2015

Poly is not actually a Basic subclass. It only implements .args for some basic compatibility.

@MooVI

This comment has been minimized.

Copy link
Contributor

MooVI commented Dec 20, 2015

@asmeurer Oh, I see. Just for my understanding in the future, what set of classes are expr.func(*expr.args) == expr supposed to be true for? One can't check whether something is a Basic subclass, because Poly is technically derived from Basic:

In [13]: issubclass(Poly, Basic)
Out[13]: True

skirpichev added a commit to skirpichev/diofant that referenced this issue Sep 16, 2016

Make Poly, PurePoly and GroebnerBasis - rebuildable from args
I don't sure if this is the right thing to do.  But anyway,
these classes are subclasses of Basic - so this does make sense.

Closes sympy/sympy#10292

skirpichev added a commit to skirpichev/diofant that referenced this issue Sep 19, 2016

Make Poly, PurePoly and GroebnerBasis - rebuildable from args
I don't sure if this is the right thing to do.  But anyway,
these classes are subclasses of Basic - so this does make sense.

We apply change poly -> poly.as_expr() in risch.py to
workaround Poly(1, x).has(x) == True.

Closes sympy/sympy#10292

skirpichev added a commit to skirpichev/diofant that referenced this issue Sep 19, 2016

Make Poly, PurePoly and GroebnerBasis - rebuildable from args
I don't sure if this is the right thing to do.  But anyway,
these classes are subclasses of Basic - so this does make sense.

We apply change poly -> poly.as_expr() in risch.py to
workaround Poly(1, x).has(x) == True.

Closes sympy/sympy#10292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment